@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | |
| 258 | 258 | //Dropping enum constrain before any operation |
| 259 | 259 | if ($initial->abstractType() == 'enum' && $this->constrained) { |
| 260 | - $operations[] = 'DROP CONSTRAINT ' . $driver->identifier($this->enumConstraint()); |
|
| 260 | + $operations[] = 'DROP CONSTRAINT '.$driver->identifier($this->enumConstraint()); |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | //Default value set and dropping |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | |
| 272 | 272 | //Nullable option |
| 273 | 273 | if ($initial->nullable != $this->nullable) { |
| 274 | - $operations[] = "ALTER COLUMN {$identifier} " . (!$this->nullable ? 'SET' : 'DROP') . ' NOT NULL'; |
|
| 274 | + $operations[] = "ALTER COLUMN {$identifier} ".(!$this->nullable ? 'SET' : 'DROP').' NOT NULL'; |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | if ($this->abstractType() == 'enum') { |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | $operations[] = "ADD CONSTRAINT {$driver->identifier($this->enumConstraint())} " |
| 284 | - . "CHECK ({$identifier} IN (" . implode(', ', $enumValues) . '))'; |
|
| 284 | + . "CHECK ({$identifier} IN (".implode(', ', $enumValues).'))'; |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | return $operations; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | protected function prepareEnum(Driver $driver): string |
| 294 | 294 | { |
| 295 | 295 | //Postgres enums are just constrained strings |
| 296 | - return '(' . $this->size . ')'; |
|
| 296 | + return '('.$this->size.')'; |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | /** |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | private function enumConstraint(): string |
| 308 | 308 | { |
| 309 | 309 | if (empty($this->constrainName)) { |
| 310 | - $this->constrainName = $this->table . '_' . $this->getName() . '_enum_' . uniqid(); |
|
| 310 | + $this->constrainName = $this->table.'_'.$this->getName().'_enum_'.uniqid(); |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | return $this->constrainName; |
@@ -404,8 +404,8 @@ discard block |
||
| 404 | 404 | |
| 405 | 405 | $constraints = $driver->query($query, [ |
| 406 | 406 | $tableOID, |
| 407 | - '(' . $column->name . '%', |
|
| 408 | - '("' . $column->name . '%' |
|
| 407 | + '('.$column->name.'%', |
|
| 408 | + '("'.$column->name.'%' |
|
| 409 | 409 | ]); |
| 410 | 410 | |
| 411 | 411 | foreach ($constraints as $constraint) { |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | */ |
| 436 | 436 | private static function resolveEnum(Driver $driver, PostgresColumn $column) |
| 437 | 437 | { |
| 438 | - $range = $driver->query('SELECT enum_range(NULL::' . $column->type . ')')->fetchColumn(0); |
|
| 438 | + $range = $driver->query('SELECT enum_range(NULL::'.$column->type.')')->fetchColumn(0); |
|
| 439 | 439 | |
| 440 | 440 | $column->enumValues = explode(',', substr($range, 1, -1)); |
| 441 | 441 | |