Skip to content

Commit f7bbfd6

Browse files
committed
Add missed dependencies.
Rename command signature. Fix missed file path. Add output after command terminated.
1 parent 929643e commit f7bbfd6

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/Console/Commands/MigrateSingle.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class MigrateSingle extends MigrateCommand
1717
/**
1818
* @var string
1919
*/
20-
protected $signature = 'migrate:one {file : The file of migration to be executed.}
20+
protected $signature = 'migrate:single {file : The file of migration to be executed.}
2121
{--database= : The database connection to use.}
2222
{--force : Force the operation to run when in production.}
2323
{--pretend : Dump the SQL queries that would be run.}';
@@ -48,8 +48,12 @@ public function fire()
4848

4949
$this->prepareDatabase();
5050

51-
$this->migrator->run($this->argument('file'), [
52-
'pretend' => $this->option('pretend'),
53-
]);
51+
$file = $this->getMigrationPath().'/'.$this->argument('file');
52+
53+
$this->migrator->run($file, ['pretend' => $this->option('pretend')]);
54+
55+
foreach ($this->migrator->getNotes() as $note) {
56+
$this->output->writeln($note);
57+
}
5458
}
5559
}

src/ServiceProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ public function register()
2525
return new DropTables();
2626
});
2727
$this->app->singleton('command.migrate.single', function ($app) {
28-
return new MigrateSingle(new Migrator($app['migration.repository']));
28+
return new MigrateSingle(
29+
new Migrator($app['migration.repository'], $app['db'], $app['files'])
30+
);
2931
});
3032

3133
$this->commands([

0 commit comments

Comments
 (0)