File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -889,6 +889,29 @@ protected static function runMigration(...$args)
889889 exit ;
890890 }
891891
892+ if ($ key === '--export-schema ' || $ key === '--xs ' ) {
893+
894+ $ removeTables = '' ;
895+ $ filename = date ('Y-m-d-His ' );
896+
897+ $ command = Console::phpCommand () . 'migration/exportSchema/ ' .$ filename ;
898+
899+ if (isset ($ args [1 ]) && isset ($ steps [0 ])) {
900+ $ filename = ($ steps [1 ]) ?: $ filename ;
901+ $ command = Console::phpCommand () . 'migration/exportSchema/ ' .$ filename ;
902+ }
903+
904+ if (isset ($ args [2 ]) && !empty ($ args [2 ])) {
905+ $ list = explode ('= ' , $ args [2 ]);
906+ $ removeTables = str_replace (', ' ,'__ ' , $ list [1 ]);
907+ $ filename = $ steps [1 ];
908+ $ command = Console::phpCommand () . 'migration/exportSchema/ ' .$ filename .'/ ' .$ removeTables ;
909+ }
910+
911+ static ::runSystemCommand ($ command );
912+ exit ;
913+ }
914+
892915 if ($ key != null ) {
893916 $ steps = explode ('= ' , $ key );
894917 }
You can’t perform that action at this time.
0 commit comments