@@ -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); |
@@ -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)) { |
@@ -365,8 +365,8 @@ discard block |
||
| 365 | 365 | // Handle id => "field_name" to support AUTO_INCREMENT |
| 366 | 366 | $column = new Column(); |
| 367 | 367 | $column->setName($options['id']) |
| 368 | - ->setType('integer') |
|
| 369 | - ->setIdentity(true); |
|
| 368 | + ->setType('integer') |
|
| 369 | + ->setIdentity(true); |
|
| 370 | 370 | |
| 371 | 371 | array_unshift($columns, $column); |
| 372 | 372 | } |
@@ -645,12 +645,12 @@ discard block |
||
| 645 | 645 | |
| 646 | 646 | $column->setName($columnInfo['name']) |
| 647 | 647 | // SQLite on PHP 8.1 returns int for notnull, older versions return a string |
| 648 | - ->setNull((int)$columnInfo['notnull'] !== 1) |
|
| 649 | - ->setDefault($default) |
|
| 650 | - ->setType($type['name']) |
|
| 651 | - ->setLimit($type['limit']) |
|
| 652 | - ->setScale($type['scale']) |
|
| 653 | - ->setIdentity($columnInfo['name'] === $identity); |
|
| 648 | + ->setNull((int)$columnInfo['notnull'] !== 1) |
|
| 649 | + ->setDefault($default) |
|
| 650 | + ->setType($type['name']) |
|
| 651 | + ->setLimit($type['limit']) |
|
| 652 | + ->setScale($type['scale']) |
|
| 653 | + ->setIdentity($columnInfo['name'] === $identity); |
|
| 654 | 654 | |
| 655 | 655 | $columns[] = $column; |
| 656 | 656 | } |
@@ -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($options['signed'] ?? true) |
|
| 272 | - ->setIdentity(true); |
|
| 270 | + ->setType('integer') |
|
| 271 | + ->setSigned($options['signed'] ?? true) |
|
| 272 | + ->setIdentity(true); |
|
| 273 | 273 | |
| 274 | 274 | if (isset($options['limit'])) { |
| 275 | 275 | $column->setLimit($options['limit']); |
@@ -442,11 +442,11 @@ discard block |
||
| 442 | 442 | |
| 443 | 443 | $column = new Column(); |
| 444 | 444 | $column->setName($columnInfo['Field']) |
| 445 | - ->setNull($columnInfo['Null'] !== 'NO') |
|
| 446 | - ->setType($phinxType['name']) |
|
| 447 | - ->setSigned(strpos($columnInfo['Type'], 'unsigned') === false) |
|
| 448 | - ->setLimit($phinxType['limit']) |
|
| 449 | - ->setScale($phinxType['scale']); |
|
| 445 | + ->setNull($columnInfo['Null'] !== 'NO') |
|
| 446 | + ->setType($phinxType['name']) |
|
| 447 | + ->setSigned(strpos($columnInfo['Type'], 'unsigned') === false) |
|
| 448 | + ->setLimit($phinxType['limit']) |
|
| 449 | + ->setScale($phinxType['scale']); |
|
| 450 | 450 | |
| 451 | 451 | if ($columnInfo['Extra'] === 'auto_increment') { |
| 452 | 452 | $column->setIdentity(true); |