@@ -544,16 +544,16 @@ |
||
544 | 544 | $updatedAt = $updatedAt === null ? 'updated_at' : $updatedAt; |
545 | 545 | |
546 | 546 | $this->addColumn($createdAt, 'timestamp', [ |
547 | - 'default' => 'CURRENT_TIMESTAMP', |
|
548 | - 'update' => '', |
|
549 | - 'timezone' => $withTimezone, |
|
550 | - ]) |
|
551 | - ->addColumn($updatedAt, 'timestamp', [ |
|
552 | - 'null' => true, |
|
553 | - 'default' => null, |
|
554 | - 'update' => 'CURRENT_TIMESTAMP', |
|
555 | - 'timezone' => $withTimezone, |
|
556 | - ]); |
|
547 | + 'default' => 'CURRENT_TIMESTAMP', |
|
548 | + 'update' => '', |
|
549 | + 'timezone' => $withTimezone, |
|
550 | + ]) |
|
551 | + ->addColumn($updatedAt, 'timestamp', [ |
|
552 | + 'null' => true, |
|
553 | + 'default' => null, |
|
554 | + 'update' => 'CURRENT_TIMESTAMP', |
|
555 | + 'timezone' => $withTimezone, |
|
556 | + ]); |
|
557 | 557 | |
558 | 558 | return $this; |
559 | 559 | } |
@@ -56,9 +56,9 @@ |
||
56 | 56 | |
57 | 57 | $fk = new ForeignKey(); |
58 | 58 | $fk->setReferencedTable($referencedTable) |
59 | - ->setColumns($columns) |
|
60 | - ->setReferencedColumns($referencedColumns) |
|
61 | - ->setOptions($options); |
|
59 | + ->setColumns($columns) |
|
60 | + ->setReferencedColumns($referencedColumns) |
|
61 | + ->setOptions($options); |
|
62 | 62 | |
63 | 63 | if ($name !== null) { |
64 | 64 | $fk->setConstraint($name); |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $options = $table->getOptions(); |
202 | 202 | $parts = $this->getSchemaName($table->getName()); |
203 | 203 | |
204 | - // Add the default primary key |
|
204 | + // Add the default primary key |
|
205 | 205 | if (!isset($options['id']) || (isset($options['id']) && $options['id'] === true)) { |
206 | 206 | $options['id'] = 'id'; |
207 | 207 | } |
@@ -210,8 +210,8 @@ discard block |
||
210 | 210 | // Handle id => "field_name" to support AUTO_INCREMENT |
211 | 211 | $column = new Column(); |
212 | 212 | $column->setName($options['id']) |
213 | - ->setType('integer') |
|
214 | - ->setIdentity(true); |
|
213 | + ->setType('integer') |
|
214 | + ->setIdentity(true); |
|
215 | 215 | |
216 | 216 | array_unshift($columns, $column); |
217 | 217 | if (isset($options['primary_key']) && (array)$options['id'] !== (array)$options['primary_key']) { |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | } |
235 | 235 | } |
236 | 236 | |
237 | - // set the primary key(s) |
|
237 | + // set the primary key(s) |
|
238 | 238 | if (isset($options['primary_key'])) { |
239 | 239 | $sql = rtrim($sql); |
240 | 240 | $sql .= sprintf(' CONSTRAINT %s PRIMARY KEY (', $this->quoteColumnName($parts['table'] . '_pkey')); |
@@ -429,11 +429,11 @@ discard block |
||
429 | 429 | |
430 | 430 | $column = new Column(); |
431 | 431 | $column->setName($columnInfo['column_name']) |
432 | - ->setType($columnType) |
|
433 | - ->setNull($columnInfo['is_nullable'] === 'YES') |
|
434 | - ->setDefault($columnDefault) |
|
435 | - ->setIdentity($columnInfo['is_identity'] === 'YES') |
|
436 | - ->setScale($columnInfo['numeric_scale']); |
|
432 | + ->setType($columnType) |
|
433 | + ->setNull($columnInfo['is_nullable'] === 'YES') |
|
434 | + ->setDefault($columnDefault) |
|
435 | + ->setIdentity($columnInfo['is_identity'] === 'YES') |
|
436 | + ->setScale($columnInfo['numeric_scale']); |
|
437 | 437 | |
438 | 438 | if (preg_match('/\bwith time zone$/', $columnInfo['data_type'])) { |
439 | 439 | $column->setTimezone(true); |
@@ -370,8 +370,8 @@ discard block |
||
370 | 370 | // Handle id => "field_name" to support AUTO_INCREMENT |
371 | 371 | $column = new Column(); |
372 | 372 | $column->setName($options['id']) |
373 | - ->setType('integer') |
|
374 | - ->setIdentity(true); |
|
373 | + ->setType('integer') |
|
374 | + ->setIdentity(true); |
|
375 | 375 | |
376 | 376 | array_unshift($columns, $column); |
377 | 377 | } |
@@ -651,12 +651,12 @@ discard block |
||
651 | 651 | $default = $this->parseDefaultValue($columnInfo['dflt_value'], $type['name']); |
652 | 652 | |
653 | 653 | $column->setName($columnInfo['name']) |
654 | - ->setNull($columnInfo['notnull'] !== '1') |
|
655 | - ->setDefault($default) |
|
656 | - ->setType($type['name']) |
|
657 | - ->setLimit($type['limit']) |
|
658 | - ->setScale($type['scale']) |
|
659 | - ->setIdentity($columnInfo['name'] === $identity); |
|
654 | + ->setNull($columnInfo['notnull'] !== '1') |
|
655 | + ->setDefault($default) |
|
656 | + ->setType($type['name']) |
|
657 | + ->setLimit($type['limit']) |
|
658 | + ->setScale($type['scale']) |
|
659 | + ->setIdentity($columnInfo['name'] === $identity); |
|
660 | 660 | |
661 | 661 | $columns[] = $column; |
662 | 662 | } |
@@ -235,8 +235,8 @@ discard block |
||
235 | 235 | // Handle id => "field_name" to support AUTO_INCREMENT |
236 | 236 | $column = new Column(); |
237 | 237 | $column->setName($options['id']) |
238 | - ->setType('integer') |
|
239 | - ->setIdentity(true); |
|
238 | + ->setType('integer') |
|
239 | + ->setIdentity(true); |
|
240 | 240 | |
241 | 241 | array_unshift($columns, $column); |
242 | 242 | if (isset($options['primary_key']) && (array)$options['id'] !== (array)$options['primary_key']) { |
@@ -465,11 +465,11 @@ discard block |
||
465 | 465 | |
466 | 466 | $column = new Column(); |
467 | 467 | $column->setName($columnInfo['name']) |
468 | - ->setType($type) |
|
469 | - ->setNull($columnInfo['null'] !== 'NO') |
|
470 | - ->setDefault($this->parseDefault($columnInfo['default'])) |
|
471 | - ->setIdentity($columnInfo['identity'] === '1') |
|
472 | - ->setComment($this->getColumnComment($columnInfo['table_name'], $columnInfo['name'])); |
|
468 | + ->setType($type) |
|
469 | + ->setNull($columnInfo['null'] !== 'NO') |
|
470 | + ->setDefault($this->parseDefault($columnInfo['default'])) |
|
471 | + ->setIdentity($columnInfo['identity'] === '1') |
|
472 | + ->setComment($this->getColumnComment($columnInfo['table_name'], $columnInfo['name'])); |
|
473 | 473 | |
474 | 474 | if (!empty($columnInfo['char_length'])) { |
475 | 475 | $column->setLimit($columnInfo['char_length']); |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | |
792 | 792 | foreach ($indexes as $name => $index) { |
793 | 793 | if ($name === $indexName) { |
794 | - return true; |
|
794 | + return true; |
|
795 | 795 | } |
796 | 796 | } |
797 | 797 |
@@ -414,7 +414,7 @@ |
||
414 | 414 | && !($action instanceof RemoveColumn) |
415 | 415 | && !($action instanceof RenameColumn) |
416 | 416 | ) { |
417 | - continue; |
|
417 | + continue; |
|
418 | 418 | } elseif (isset($this->tableCreates[$action->getTable()->getName()])) { |
419 | 419 | continue; |
420 | 420 | } |
@@ -8,8 +8,8 @@ |
||
8 | 8 | */ |
9 | 9 | return function () { |
10 | 10 | $files = [ |
11 | - __DIR__ . '/../../../autoload.php', // composer dependency |
|
12 | - __DIR__ . '/../vendor/autoload.php', // stand-alone package |
|
11 | + __DIR__ . '/../../../autoload.php', // composer dependency |
|
12 | + __DIR__ . '/../vendor/autoload.php', // stand-alone package |
|
13 | 13 | ]; |
14 | 14 | foreach ($files as $file) { |
15 | 15 | if (is_file($file)) { |
@@ -267,9 +267,9 @@ discard block |
||
267 | 267 | // Handle id => "field_name" to support AUTO_INCREMENT |
268 | 268 | $column = new Column(); |
269 | 269 | $column->setName($options['id']) |
270 | - ->setType('integer') |
|
271 | - ->setSigned(isset($options['signed']) ? $options['signed'] : true) |
|
272 | - ->setIdentity(true); |
|
270 | + ->setType('integer') |
|
271 | + ->setSigned(isset($options['signed']) ? $options['signed'] : true) |
|
272 | + ->setIdentity(true); |
|
273 | 273 | |
274 | 274 | if (isset($options['limit'])) { |
275 | 275 | $column->setLimit($options['limit']); |
@@ -444,12 +444,12 @@ discard block |
||
444 | 444 | |
445 | 445 | $column = new Column(); |
446 | 446 | $column->setName($columnInfo['Field']) |
447 | - ->setNull($columnInfo['Null'] !== 'NO') |
|
448 | - ->setDefault($columnInfo['Default']) |
|
449 | - ->setType($phinxType['name']) |
|
450 | - ->setSigned(strpos($columnInfo['Type'], 'unsigned') === false) |
|
451 | - ->setLimit($phinxType['limit']) |
|
452 | - ->setScale($phinxType['scale']); |
|
447 | + ->setNull($columnInfo['Null'] !== 'NO') |
|
448 | + ->setDefault($columnInfo['Default']) |
|
449 | + ->setType($phinxType['name']) |
|
450 | + ->setSigned(strpos($columnInfo['Type'], 'unsigned') === false) |
|
451 | + ->setLimit($phinxType['limit']) |
|
452 | + ->setScale($phinxType['scale']); |
|
453 | 453 | |
454 | 454 | if ($columnInfo['Extra'] === 'auto_increment') { |
455 | 455 | $column->setIdentity(true); |