Skip to content

Commit 3e21919

Browse files
committed
updated for 5.8
1 parent f209742 commit 3e21919

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
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": {

src/Schema.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)