final class TableRenaming
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

old TO new: one rename of RENAME TABLE.

The statement records the resolution of the old name, at the time the rename runs, as the relation fact of this node. Source: https://dev.mysql.com/doc/refman/8.4/en/rename-table.html.

Moving a table to another databasedoctest
$renaming = new \SqlSemantics\Platform\MySql\Statement\Alter\TableRenaming(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\QualifiedName(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('t')), new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\QualifiedName(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('t'), new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('archive')));
    $renaming->to->schema?->value // => 'archive'

Properties§

Methods§

public function __construct(public QualifiedName $from, public QualifiedName $to)

Parameters

$fromQualifiedNameThe current name with its optional database
$toQualifiedNameThe new name with its optional database
Calls 1
public function render(Output $out): void

Writes the rename.

Parameters

$outOutput
Calls 4

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 1
Constant reads 1