protected function task() { $adapter = SqlBase::adapter(); $filesDir = $this->app->config()['paths']['root']->expand('db'); $migrator = new Migrator($adapter, $filesDir); $migrator->run(); }
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); }
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); }