取消config option 和path配置参数 目录位置固定
This commit is contained in:
parent
9666d85b1b
commit
debc818a4e
|
@ -17,6 +17,8 @@ use think\facade\Config;
|
|||
|
||||
abstract class Command extends \think\console\Command
|
||||
{
|
||||
protected $config = 'database';
|
||||
|
||||
public function getAdapter()
|
||||
{
|
||||
if (isset($this->adapter)) {
|
||||
|
|
|
@ -17,7 +17,6 @@ use Phinx\Migration\AbstractMigration;
|
|||
use Phinx\Migration\MigrationInterface;
|
||||
use Phinx\Util\Util;
|
||||
use think\console\Input;
|
||||
use think\console\input\Option as InputOption;
|
||||
use think\console\Output;
|
||||
use think\facade\Env;
|
||||
use think\migration\Command;
|
||||
|
@ -30,27 +29,9 @@ abstract class Migrate extends Command
|
|||
*/
|
||||
protected $migrations;
|
||||
|
||||
public function __construct($name = null)
|
||||
{
|
||||
|
||||
parent::__construct($name);
|
||||
|
||||
$this->addOption('--config', null, InputOption::VALUE_REQUIRED, 'The database config name', 'database');
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
* @param Input $input An InputInterface instance
|
||||
* @param Output $output An OutputInterface instance
|
||||
*/
|
||||
protected function initialize(Input $input, Output $output)
|
||||
{
|
||||
$this->config = $input->getOption('config');
|
||||
}
|
||||
|
||||
protected function getPath()
|
||||
{
|
||||
return $this->getConfig('path', Env::get('root_path') . 'database') . DIRECTORY_SEPARATOR . 'migrations' . ('database' !== $this->config ? DIRECTORY_SEPARATOR . $this->config : '');
|
||||
return Env::get('root_path') . 'database' . DIRECTORY_SEPARATOR . 'migrations';
|
||||
}
|
||||
|
||||
protected function executeMigration(MigrationInterface $migration, $direction = MigrationInterface::UP)
|
||||
|
|
|
@ -27,7 +27,7 @@ abstract class Seed extends Command
|
|||
|
||||
protected function getPath()
|
||||
{
|
||||
return $this->getConfig('path', Env::get('root_path') . 'database') . DIRECTORY_SEPARATOR . 'seeds';
|
||||
return Env::get('root_path') . 'database' . DIRECTORY_SEPARATOR . 'seeds';
|
||||
}
|
||||
|
||||
public function getSeeds()
|
||||
|
|
Loading…
Reference in New Issue
Block a user