@@ -103,18 +103,18 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | $tableIndexes = $this->getTableIndexes($value['table_name']); |
| 105 | 105 | if (!is_null($tableIndexes) && count($tableIndexes)){ |
| 106 | - foreach ($tableIndexes as $index) { |
|
| 106 | + foreach ($tableIndexes as $index) { |
|
| 107 | 107 | if(Str::endsWith($index['Key_name'], '_index')) { |
| 108 | - $up .= ' $' . "table->index('" . $index['Column_name'] . "');\n"; |
|
| 108 | + $up .= ' $' . "table->index('" . $index['Column_name'] . "');\n"; |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | - } |
|
| 111 | + } |
|
| 112 | 112 | |
| 113 | 113 | $up .= " });\n\n"; |
| 114 | 114 | $Constraint = $ConstraintDown = ""; |
| 115 | 115 | /** |
| 116 | - * @var array $tableConstraints |
|
| 117 | - */ |
|
| 116 | + * @var array $tableConstraints |
|
| 117 | + */ |
|
| 118 | 118 | $tableConstraints = $this->getTableConstraints($value['table_name']); |
| 119 | 119 | if (!is_null($tableConstraints) && count($tableConstraints)) { |
| 120 | 120 | $Constraint = $ConstraintDown = " |
@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | public function columnType($type) |
| 145 | 145 | { |
| 146 | - $columns = ['int'=> 'integer','smallint' => 'smallInteger','bigint' => 'bigInteger','char '=>'string', 'varchar' => 'string','float' => 'float','double' => 'double','decimal' => 'decimal','tinyint' => 'boolean','date' => 'date','timestamp' => 'timestamp','datetime' => 'dateTime','longtext' => 'longText','mediumtext' => 'mediumText','text' => 'text','longblob' => 'binary' ,'blob' => 'binary','enum' => 'enum']; |
|
| 147 | - return array_key_exists($type, $columns) ? $columns[$type] : ''; |
|
| 146 | + $columns = ['int'=> 'integer','smallint' => 'smallInteger','bigint' => 'bigInteger','char '=>'string', 'varchar' => 'string','float' => 'float','double' => 'double','decimal' => 'decimal','tinyint' => 'boolean','date' => 'date','timestamp' => 'timestamp','datetime' => 'dateTime','longtext' => 'longText','mediumtext' => 'mediumText','text' => 'text','longblob' => 'binary' ,'blob' => 'binary','enum' => 'enum']; |
|
| 147 | + return array_key_exists($type, $columns) ? $columns[$type] : ''; |
|
| 148 | 148 | |
| 149 | 149 | |
| 150 | 150 | |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | ); |
| 35 | 35 | // Instatiate a new DbMigrations class to send to the handler |
| 36 | 36 | $this->migrator = $migrator; |
| 37 | - // Load the alias |
|
| 37 | + // Load the alias |
|
| 38 | 38 | $this->loadAlias(); |
| 39 | - // Handle the artisan commands |
|
| 39 | + // Handle the artisan commands |
|
| 40 | 40 | $this->registerCommands(); |
| 41 | 41 | |
| 42 | 42 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $this->registerMigrationsCommand(); |
| 63 | 63 | $this->registerSeedsCommand(); |
| 64 | 64 | $this->registerRemoteCommand(); |
| 65 | - } |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * Register the migrations command |
@@ -22,8 +22,8 @@ |
||
| 22 | 22 | public function boot() |
| 23 | 23 | { |
| 24 | 24 | |
| 25 | - $loader = AliasLoader::getInstance(); |
|
| 26 | - $loader->alias('DbMigrations', 'Facades\DbMigrations'); |
|
| 25 | + $loader = AliasLoader::getInstance(); |
|
| 26 | + $loader->alias('DbMigrations', 'Facades\DbMigrations'); |
|
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | } |