芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/midiatech/vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php
addOption('--environment', '-e', InputOption::VALUE_REQUIRED, 'The target environment'); $this->setName('migrate') ->setDescription('Migrate the database') ->addOption('--target', '-t', InputOption::VALUE_REQUIRED, 'The version number to migrate to') ->addOption('--date', '-d', InputOption::VALUE_REQUIRED, 'The date to migrate to') ->addOption('--dry-run', '-x', InputOption::VALUE_NONE, 'Dump query to standard output instead of executing it') ->setHelp( <<
migrate command runs all available migrations, optionally up to a specific version
phinx migrate -e development
phinx migrate -e development -t 20110103081132
phinx migrate -e development -d 20110103
phinx migrate -e development -v
EOT ); } /** * Migrate the database. * * @param \Symfony\Component\Console\Input\InputInterface $input * @param \Symfony\Component\Console\Output\OutputInterface $output * @return int integer 0 on success, or an error code. */ protected function execute(InputInterface $input, OutputInterface $output) { $this->bootstrap($input, $output); $version = $input->getOption('target'); $environment = $input->getOption('environment'); $date = $input->getOption('date'); if ($environment === null) { $environment = $this->getConfig()->getDefaultEnvironment(); $output->writeln('
warning
no environment specified, defaulting to: ' . $environment); } else { $output->writeln('
using environment
' . $environment); } $envOptions = $this->getConfig()->getEnvironment($environment); if (isset($envOptions['adapter'])) { $output->writeln('
using adapter
' . $envOptions['adapter']); } if (isset($envOptions['wrapper'])) { $output->writeln('
using wrapper
' . $envOptions['wrapper']); } if (isset($envOptions['name'])) { $output->writeln('
using database
' . $envOptions['name']); } else { $output->writeln('
Could not determine database name! Please specify a database name in your config file.
'); return 1; } if (isset($envOptions['table_prefix'])) { $output->writeln('
using table prefix
' . $envOptions['table_prefix']); } if (isset($envOptions['table_suffix'])) { $output->writeln('
using table suffix
' . $envOptions['table_suffix']); } // run the migrations $start = microtime(true); if ($date !== null) { $this->getManager()->migrateToDateTime($environment, new \DateTime($date)); } else { $this->getManager()->migrate($environment, $version); } $end = microtime(true); $output->writeln(''); $output->writeln('
All Done. Took ' . sprintf('%.4fs', $end - $start) . '
'); return 0; } }