예제 #1
0
 protected function task()
 {
     $adapter = SqlBase::adapter();
     $filesDir = $this->app->config()['paths']['root']->expand('db');
     $migrator = new Migrator($adapter, $filesDir);
     $migrator->run();
 }
예제 #2
0
 protected function task()
 {
     $file = $this->app->config()['paths']['root']->expand('db', 'schema.sql');
     $connection = SqlBase::adapter()->getDriver()->getConnection();
     $exporter = new Exporter();
     $dump = $exporter->export($connection);
     file_put_contents($file, $dump);
 }
예제 #3
0
 protected function task()
 {
     $sqlFile = $this->app->config()['paths']['root']->expand('db', 'schema.sql');
     if (!is_file($sqlFile)) {
         $this->output->write("File db/schema.sql not found");
         return;
     }
     $connection = SqlBase::adapter()->getDriver()->getConnection();
     $importer = new Importer();
     $importer->import($connection, $sqlFile);
 }