classColumnPosition
final class ColumnPosition
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.FIRST or AFTER column: where an added or changed column goes in the column order of the table.
Without a position an added column goes last and a changed column stays where it is. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html#alter-table-redefine-column.
(new \SqlSemantics\Platform\MySql\Statement\Alter\Column\ColumnPosition(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('id')))->after?->value // => 'id'Properties§
public Name|null $afterMethods§
public function __construct(public Name|null $after)Parameters
$after | Name|null | The column the column follows, or null for FIRST |
public function render(Output $out): voidWrites the position.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 41
- class-const NameUse::Column() line 43
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ColumnPositionTestcalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\ColumnItemRule::position() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/ColumnItemRule.php:225
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\ColumnItemRule::position() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/ColumnItemRule.php:226
Type declarations 4
- type SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\ColumnItemRule packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/ColumnItemRule.php:219
- type SqlSemantics\Platform\MySql\Rules\TableChange\ColumnChanges packages/sql-semantics-mysql/src/Rules/TableChange/ColumnChanges.php:277
- type SqlSemantics\Platform\MySql\Statement\Alter\Column\AddColumn packages/sql-semantics-mysql/src/Statement/Alter/Column/AddColumn.php:36
- type SqlSemantics\Platform\MySql\Statement\Alter\Column\ChangeColumn packages/sql-semantics-mysql/src/Statement/Alter/Column/ChangeColumn.php:41