File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class MigrateSingle extends MigrateCommand
17
17
/**
18
18
* @var string
19
19
*/
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.}
21
21
{--database= : The database connection to use.}
22
22
{--force : Force the operation to run when in production.}
23
23
{--pretend : Dump the SQL queries that would be run.} ' ;
@@ -48,8 +48,12 @@ public function fire()
48
48
49
49
$ this ->prepareDatabase ();
50
50
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
+ }
54
58
}
55
59
}
Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ public function register()
25
25
return new DropTables ();
26
26
});
27
27
$ 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
+ );
29
31
});
30
32
31
33
$ this ->commands ([
You can’t perform that action at this time.
0 commit comments