File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 2222 ],
2323 "require" : {
2424 "php" : " ~5.6|~7.0" ,
25- "illuminate/support" : " 5.6.* || 5.7.*" ,
26- "spatie/regex" : " ^1.3 " ,
27- "doctrine/dbal" : " ^2.8 "
25+ "illuminate/support" : " 5.6.* || 5.7.* || 5.8.* " ,
26+ "spatie/regex" : " ^1.4 " ,
27+ "doctrine/dbal" : " ^2.9 "
2828 },
2929 "autoload" : {
3030 "psr-4" : {
Original file line number Diff line number Diff line change @@ -23,9 +23,10 @@ class Schema
2323 public function __construct ($ schema , SyncMigrateCommand $ writeIn )
2424 {
2525 $ this ->schema = $ schema ;
26+ $ this ->writeIn = $ writeIn ;
27+
2628 $ this ->name = $ this ->getName ($ schema ->group (1 ));
2729 $ this ->table = DB ::getTablePrefix () . $ this ->name ;
28- $ this ->writeIn = $ writeIn ;
2930 }
3031
3132 public function process ()
@@ -51,7 +52,7 @@ protected function create()
5152 eval ($ this ->schema ->group (2 ));
5253 });
5354
54- $ this ->output ()->warn ("New table <fg=white;bg=red > {$ this ->table } </> was created " );
55+ $ this ->output ()->warn ("New table <fg=white;bg=green > {$ this ->table } </> was created " );
5556 }
5657
5758 protected function sync ()
@@ -86,6 +87,12 @@ protected function schemaEmpty()
8687
8788 protected function getName ($ name )
8889 {
90+ //TODO: https://github.com/awssat/laravel-sync-migration/issues/2
91+ if (preg_match ('/[ \'|"]\s?\.\s?\$/ ' , $ name ) || preg_match ('/\$[a-zA-z0-9-_]+\s?\.\s?[ \'|"]/ ' , $ name )) {
92+ $ this ->output ()->error ("Using variables as table names (<fg=black;bg=white> {$ name } </>) is not supported currentlly, see <href=https://github.com/awssat/laravel-sync-migration/issues/2> issue#2 </> " );
93+ exit ;
94+ }
95+
8996 return str_replace (['\'' , '" ' ], '' , $ name );
9097 }
9198
You can’t perform that action at this time.
0 commit comments