mirror of
				https://github.com/slawkens/myaac.git
				synced 2025-11-04 09:46:23 +01:00 
			
		
		
		
	Add migrate command to manually upgrade db, incase auto migrate is disabled
This commit is contained in:
		
							
								
								
									
										28
									
								
								system/src/Commands/MigrateCommand.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								system/src/Commands/MigrateCommand.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace MyAAC\Commands;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\Console\Input\InputArgument;
 | 
			
		||||
use Symfony\Component\Console\Input\InputInterface;
 | 
			
		||||
use Symfony\Component\Console\Output\OutputInterface;
 | 
			
		||||
use Symfony\Component\Console\Style\SymfonyStyle;
 | 
			
		||||
 | 
			
		||||
class MigrateCommand extends Command
 | 
			
		||||
{
 | 
			
		||||
	protected function configure(): void
 | 
			
		||||
	{
 | 
			
		||||
		$this->setName('migrate')
 | 
			
		||||
			->setDescription('This command updates the AAC to latest migration');
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	protected function execute(InputInterface $input, OutputInterface $output): int
 | 
			
		||||
	{
 | 
			
		||||
		require SYSTEM . 'init.php';
 | 
			
		||||
 | 
			
		||||
		$io = new SymfonyStyle($input, $output);
 | 
			
		||||
		require SYSTEM . 'migrate.php';
 | 
			
		||||
 | 
			
		||||
		$io->success('Migrated to latest version');
 | 
			
		||||
		return Command::SUCCESS;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user