classAlterTableMutation
final class AlterTableMutation
implements ShadowMutation
Applies ALTER TABLE operation to the virtual schema. This mutation modifies the table definition in the TableDefinitionRegistry.
Methods§
public function __construct(
string $tableName,
AlterStatement $alterStatement,
TableDefinitionRegistry $registry,
SchemaParser $schemaParser,
)Configure the dependencies used by this operation.
Parameters
$tableName | string | |
$alterStatement | AlterStatement | |
$registry | TableDefinitionRegistry | |
$schemaParser | SchemaParser |
public function apply(ShadowStore $store, array $rows): void{@inheritDoc}
Parameters
$store | ShadowStore | |
$rows | array |
Test cases 117
AlterTableMutationTest::testAddColumnBacktickNameNormalizedcallsAlterTableMutationTest::testAddColumnWithBacktickedNameIsNormalizedcallsAlterTableMutationTest::testAddCompositePrimaryKeycallsAlterTableMutationTest::testAddForeignKeySkippedcallsAlterTableMutationTest::testAddPrimaryKeycallsAlterTableMutationTest::testAddPrimaryKeyDoesNotRemoveExistingColumnscallsAlterTableMutationTest::testAddPrimaryKeyPopulatesPrimaryKeyscallsAlterTableMutationTest::testAlterDropDefaultUnsupportedcallsAlterTableMutationTest::testAlterSetDefaultUnsupportedcallsAlterTableMutationTest::testApplyAddColumnAddsNewColumncallsAlterTableMutationTest::testApplyAddColumnPreservesForeignKeyMetadatacallsAlterTableMutationTest::testApplyAddColumnPreservesPartitionMetadatacallsAlterTableMutationTest::testApplyAddColumnPreservesQuotedForeignKeyIdentifierscallsAlterTableMutationTest::testApplyAddColumnThrowsExceptionWhenColumnExistscallsAlterTableMutationTest::testApplyAddColumnWithoutColumnKeywordcallsAlterTableMutationTest::testApplyAddForeignKeyDoesNotAffectColumnscallsAlterTableMutationTest::testApplyAddForeignKeyDoesNotThrowcallsAlterTableMutationTest::testApplyAddForeignKeyLeavesSchemaUnchangedcallsAlterTableMutationTest::testApplyAddIndexThrowsUnsupportedcallsAlterTableMutationTest::testApplyAddKeyThrowsUnsupportedcallsAlterTableMutationTest::testApplyAddPrimaryKeyPreservesAllColumnscallsAlterTableMutationTest::testApplyChangeColumnNotFoundThrowscallsAlterTableMutationTest::testApplyChangeColumnRenamesAndModifiesColumncallsAlterTableMutationTest::testApplyChangeColumnSameNameKeepsStoreUnchangedcallsAlterTableMutationTest::testApplyChangeColumnThrowsExceptionWhenColumnNotFoundcallsAlterTableMutationTest::testApplyChangeColumnUpdatesStoreColumnNamecallsAlterTableMutationTest::testApplyDropColumnEmptyStoreDoesNotModifyStorecallsAlterTableMutationTest::testApplyDropColumnRemovesColumncallsAlterTableMutationTest::testApplyDropColumnRemovesColumnFromStoreRowscallsAlterTableMutationTest::testApplyDropColumnThrowsExceptionWhenColumnNotFoundcallsAlterTableMutationTest::testApplyDropColumnWithoutColumnKeywordRemovesColumncallsAlterTableMutationTest::testApplyDropForeignKeyDoesNotAffectColumnscallsAlterTableMutationTest::testApplyDropForeignKeyDoesNotThrowcallsAlterTableMutationTest::testApplyDropForeignKeyLeavesSchemaUnchangedcallsAlterTableMutationTest::testApplyDropIndexThrowsUnsupportedcallsAlterTableMutationTest::testApplyDropKeyThrowsUnsupportedcallsAlterTableMutationTest::testApplyDropPrimaryKeyRemovesPkConstraintcallsAlterTableMutationTest::testApplyDropPrimaryKeyRemovesPrimaryKeycallsAlterTableMutationTest::testApplyModifyColumnModifiesColumnDefinitioncallsAlterTableMutationTest::testApplyModifyColumnPreservesOtherColumnscallsAlterTableMutationTest::testApplyModifyColumnThrowsExceptionWhenColumnNotFoundcallsAlterTableMutationTest::testApplyNotNullColumnPreservesNotNullInRoundTripcallsAlterTableMutationTest::testApplyRenameColumnEmptyStoreDoesNotModifyStorecallsAlterTableMutationTest::testApplyRenameColumnNotFoundThrowsExceptioncallsAlterTableMutationTest::testApplyRenameColumnRenamesExistingColumncallsAlterTableMutationTest::testApplyRenameColumnThrowsExceptionWhenColumnNotFoundcallsAlterTableMutationTest::testApplyRenameColumnUpdatesDefinitionAndStorecallsAlterTableMutationTest::testApplyRenameColumnUpdatesFieldNameInSchemacallsAlterTableMutationTest::testApplyRenameColumnUpdatesStoreDatacallsAlterTableMutationTest::testApplyRenameIndexThrowsUnsupportedcallsAlterTableMutationTest::testApplyRenameKeyThrowsUnsupportedcallsAlterTableMutationTest::testApplyRenameTableEmptyStoreTransfersEmptycallsAlterTableMutationTest::testApplyRenameTableRegistersNewNameInRegistrycallsAlterTableMutationTest::testApplyRenameTableTransfersStoreDataToNewNamecallsAlterTableMutationTest::testApplySchemaNotFoundThrowscallsAlterTableMutationTest::testApplySchemaNotFoundThrowsExceptioncallsAlterTableMutationTest::testApplyThrowsExceptionWhenTableNotFoundcallsAlterTableMutationTest::testApplyUnregistersOldDefinitionAndRegistersNewcallsAlterTableMutationTest::testApplyUnregistersOldDefinitionBeforeReregisteringcallsAlterTableMutationTest::testApplyUnregistersOldTableBeforeRegisteringcallsAlterTableMutationTest::testApplyUnsupportedAlterThrowsExceptioncallsAlterTableMutationTest::testBuildCreateTableSqlColumnTypeFallbackToColumnTypescallsAlterTableMutationTest::testBuildCreateTableSqlColumnWithNoTypedColumnFallsBackToColumnTypescallsAlterTableMutationTest::testBuildCreateTableSqlCompositePkBacktickWrappingExactcallsAlterTableMutationTest::testBuildCreateTableSqlCompositePkContainsBacktickWrappedColumnscallsAlterTableMutationTest::testBuildCreateTableSqlCompositePrimaryKeycallsAlterTableMutationTest::testBuildCreateTableSqlCompositePrimaryKeyProducesBacktickedColumnscallsAlterTableMutationTest::testBuildCreateTableSqlCompositePrimaryKeyWrapsBacktickscallsAlterTableMutationTest::testBuildCreateTableSqlCorrectTypedColumnNativeTypecallsAlterTableMutationTest::testBuildCreateTableSqlFallsBackToColumnTypesWhenNoTypedColumncallsAlterTableMutationTest::testBuildCreateTableSqlFallsBackToTextWhenNoColumnTypescallsAlterTableMutationTest::testBuildCreateTableSqlFallsBackToTextWhenNoTypescallsAlterTableMutationTest::testBuildCreateTableSqlPreservesNotNullcallsAlterTableMutationTest::testBuildCreateTableSqlPreservesUniqueConstraintscallsAlterTableMutationTest::testBuildCreateTableSqlPreservesUniqueConstraintsAfterAddColumncallsAlterTableMutationTest::testBuildCreateTableSqlSinglePrimaryKeycallsAlterTableMutationTest::testBuildCreateTableSqlUniqueConstraintClosingParenthesisExactcallsAlterTableMutationTest::testBuildCreateTableSqlUniqueConstraintContainsClosingParenthesiscallsAlterTableMutationTest::testBuildCreateTableSqlUniqueConstraintsProducesBacktickedColumnscallsAlterTableMutationTest::testBuildCreateTableSqlUniqueConstraintWrapsBacktickscallsAlterTableMutationTest::testBuildCreateTableSqlUsesTypedColumnNativeTypecallsAlterTableMutationTest::testBuildCreateTableSqlWithCompositePrimaryKeyBacktickscallsAlterTableMutationTest::testChangeColumnNotFoundThrowscallsAlterTableMutationTest::testChangeColumnRenamesAndUpdatesTypecallsAlterTableMutationTest::testChangeColumnSameNameModifiesTypecallsAlterTableMutationTest::testChangeColumnUpdatesStoreColumnKeycallsAlterTableMutationTest::testChangeWithoutColumnKeywordcallsAlterTableMutationTest::testDropColumnNotFoundThrowscallsAlterTableMutationTest::testDropColumnRemovesFromMultipleStoreRowscallsAlterTableMutationTest::testDropColumnRemovesFromStoreDatacallsAlterTableMutationTest::testDropColumnRemovesFromStoreRowscallsAlterTableMutationTest::testDropColumnUpdatesFieldsArrayIndicescallsAlterTableMutationTest::testDropColumnUpdatesFieldsArrayValuescallsAlterTableMutationTest::testDropColumnWithEmptyStorecallsAlterTableMutationTest::testDropColumnWithoutColumnKeywordcallsAlterTableMutationTest::testDropColumnWithoutColumnKeywordRemovesColumncallsAlterTableMutationTest::testDropForeignKeySkippedcallsAlterTableMutationTest::testDropPrimaryKeyRemovesCompositePrimaryKeycallsAlterTableMutationTest::testDropPrimaryKeyRemovesPkFromDefinitioncallsAlterTableMutationTest::testModifyColumnChangesTypecallsAlterTableMutationTest::testModifyColumnNotFoundThrowscallsAlterTableMutationTest::testModifyColumnPreservesOtherColumnTypescallsAlterTableMutationTest::testModifyColumnUpdatesColumnTypeInSchemacallsAlterTableMutationTest::testModifyColumnWithMultipleFieldsOnlyModifiesTargetcallsAlterTableMutationTest::testModifyWithoutColumnKeywordcallsAlterTableMutationTest::testMultipleAlterOperationscallsAlterTableMutationTest::testRenameColumnEmptyStoreDoesNotModifyStorecallsAlterTableMutationTest::testRenameColumnNotFoundThrowscallsAlterTableMutationTest::testRenameColumnUpdatesStoreColumnNamecallsAlterTableMutationTest::testRenameColumnUpdatesStoreDatacallsAlterTableMutationTest::testRenameTableEmptyStoreDoesNotModifyStorecallsAlterTableMutationTest::testRenameTableMovesDataAndRegistrycallsAlterTableMutationTest::testRenameTablePreservesSchemaDefinitioncallsAlterTableMutationTest::testRenameTableTransfersStoreDatacallsAlterTableMutationTest::testRenameTableUnregistersOldNamecallsAlterTableMutationTest::testRenameTableUpdatesRegistryAndStorecallsAlterTableMutationTest::testUnsupportedOperationThrowscalls
Calls 12
- method-call TableDefinitionRegistry::get() line 49
- new SchemaNotFoundException line 51
- method-call
AlterStatement::build()line 51 - method-call CreateTableRenderer::buildCreateTableSql() line 54
- new CreateTableRenderer line 54
- new
Parserline 56 - new
RuntimeExceptionline 58 - method-call OperationApplier::applyOperation() line 67
- new OperationApplier line 67
- method-call SchemaParser::parse() line 71
- method-call TableDefinitionRegistry::unregister() line 79
- method-call TableDefinitionRegistry::register() line 80
public function tableName(): string{@inheritDoc}
Returns
stringTest cases 5
AlterTableMutationTest::testApplyRenameTableRegistersNewNameInRegistrycallsAlterTableMutationTest::testApplyRenameTableTransfersStoreDataToNewNamecallsAlterTableMutationTest::testRenameTableMovesDataAndRegistrycallsAlterTableMutationTest::testRenameTableUpdatesRegistryAndStorecallsAlterTableMutationTest::testTableNameReturnsTableNamecalls
Private surface 4§
Implementation details, listed for orientation only.
private string $tableNameprivate AlterStatement $alterStatementprivate TableDefinitionRegistry $registryprivate SchemaParser $schemaParserTest cases 128§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 118
AlterTableMutationTest::testAddColumnBacktickNameNormalizedcallsAlterTableMutationTest::testAddColumnWithBacktickedNameIsNormalizedcallsAlterTableMutationTest::testAddCompositePrimaryKeycallsAlterTableMutationTest::testAddForeignKeySkippedcallsAlterTableMutationTest::testAddPrimaryKeycallsAlterTableMutationTest::testAddPrimaryKeyDoesNotRemoveExistingColumnscallsAlterTableMutationTest::testAddPrimaryKeyPopulatesPrimaryKeyscallsAlterTableMutationTest::testAlterDropDefaultUnsupportedcallsAlterTableMutationTest::testAlterSetDefaultUnsupportedcallsAlterTableMutationTest::testApplyAddColumnAddsNewColumncallsAlterTableMutationTest::testApplyAddColumnPreservesForeignKeyMetadatacallsAlterTableMutationTest::testApplyAddColumnPreservesPartitionMetadatacallsAlterTableMutationTest::testApplyAddColumnPreservesQuotedForeignKeyIdentifierscallsAlterTableMutationTest::testApplyAddColumnThrowsExceptionWhenColumnExistscallsAlterTableMutationTest::testApplyAddColumnWithoutColumnKeywordcallsAlterTableMutationTest::testApplyAddForeignKeyDoesNotAffectColumnscallsAlterTableMutationTest::testApplyAddForeignKeyDoesNotThrowcallsAlterTableMutationTest::testApplyAddForeignKeyLeavesSchemaUnchangedcallsAlterTableMutationTest::testApplyAddIndexThrowsUnsupportedcallsAlterTableMutationTest::testApplyAddKeyThrowsUnsupportedcallsAlterTableMutationTest::testApplyAddPrimaryKeyPreservesAllColumnscallsAlterTableMutationTest::testApplyChangeColumnNotFoundThrowscallsAlterTableMutationTest::testApplyChangeColumnRenamesAndModifiesColumncallsAlterTableMutationTest::testApplyChangeColumnSameNameKeepsStoreUnchangedcallsAlterTableMutationTest::testApplyChangeColumnThrowsExceptionWhenColumnNotFoundcallsAlterTableMutationTest::testApplyChangeColumnUpdatesStoreColumnNamecallsAlterTableMutationTest::testApplyDropColumnEmptyStoreDoesNotModifyStorecallsAlterTableMutationTest::testApplyDropColumnRemovesColumncallsAlterTableMutationTest::testApplyDropColumnRemovesColumnFromStoreRowscallsAlterTableMutationTest::testApplyDropColumnThrowsExceptionWhenColumnNotFoundcallsAlterTableMutationTest::testApplyDropColumnWithoutColumnKeywordRemovesColumncallsAlterTableMutationTest::testApplyDropForeignKeyDoesNotAffectColumnscallsAlterTableMutationTest::testApplyDropForeignKeyDoesNotThrowcallsAlterTableMutationTest::testApplyDropForeignKeyLeavesSchemaUnchangedcallsAlterTableMutationTest::testApplyDropIndexThrowsUnsupportedcallsAlterTableMutationTest::testApplyDropKeyThrowsUnsupportedcallsAlterTableMutationTest::testApplyDropPrimaryKeyRemovesPkConstraintcallsAlterTableMutationTest::testApplyDropPrimaryKeyRemovesPrimaryKeycallsAlterTableMutationTest::testApplyModifyColumnModifiesColumnDefinitioncallsAlterTableMutationTest::testApplyModifyColumnPreservesOtherColumnscallsAlterTableMutationTest::testApplyModifyColumnThrowsExceptionWhenColumnNotFoundcallsAlterTableMutationTest::testApplyNotNullColumnPreservesNotNullInRoundTripcallsAlterTableMutationTest::testApplyRenameColumnEmptyStoreDoesNotModifyStorecallsAlterTableMutationTest::testApplyRenameColumnNotFoundThrowsExceptioncallsAlterTableMutationTest::testApplyRenameColumnRenamesExistingColumncallsAlterTableMutationTest::testApplyRenameColumnThrowsExceptionWhenColumnNotFoundcallsAlterTableMutationTest::testApplyRenameColumnUpdatesDefinitionAndStorecallsAlterTableMutationTest::testApplyRenameColumnUpdatesFieldNameInSchemacallsAlterTableMutationTest::testApplyRenameColumnUpdatesStoreDatacallsAlterTableMutationTest::testApplyRenameIndexThrowsUnsupportedcallsAlterTableMutationTest::testApplyRenameKeyThrowsUnsupportedcallsAlterTableMutationTest::testApplyRenameTableEmptyStoreTransfersEmptycallsAlterTableMutationTest::testApplyRenameTableRegistersNewNameInRegistrycallsAlterTableMutationTest::testApplyRenameTableTransfersStoreDataToNewNamecallsAlterTableMutationTest::testApplySchemaNotFoundThrowscallsAlterTableMutationTest::testApplySchemaNotFoundThrowsExceptioncallsAlterTableMutationTest::testApplyThrowsExceptionWhenTableNotFoundcallsAlterTableMutationTest::testApplyUnregistersOldDefinitionAndRegistersNewcallsAlterTableMutationTest::testApplyUnregistersOldDefinitionBeforeReregisteringcallsAlterTableMutationTest::testApplyUnregistersOldTableBeforeRegisteringcallsAlterTableMutationTest::testApplyUnsupportedAlterThrowsExceptioncallsAlterTableMutationTest::testBuildCreateTableSqlColumnTypeFallbackToColumnTypescallsAlterTableMutationTest::testBuildCreateTableSqlColumnWithNoTypedColumnFallsBackToColumnTypescallsAlterTableMutationTest::testBuildCreateTableSqlCompositePkBacktickWrappingExactcallsAlterTableMutationTest::testBuildCreateTableSqlCompositePkContainsBacktickWrappedColumnscallsAlterTableMutationTest::testBuildCreateTableSqlCompositePrimaryKeycallsAlterTableMutationTest::testBuildCreateTableSqlCompositePrimaryKeyProducesBacktickedColumnscallsAlterTableMutationTest::testBuildCreateTableSqlCompositePrimaryKeyWrapsBacktickscallsAlterTableMutationTest::testBuildCreateTableSqlCorrectTypedColumnNativeTypecallsAlterTableMutationTest::testBuildCreateTableSqlFallsBackToColumnTypesWhenNoTypedColumncallsAlterTableMutationTest::testBuildCreateTableSqlFallsBackToTextWhenNoColumnTypescallsAlterTableMutationTest::testBuildCreateTableSqlFallsBackToTextWhenNoTypescallsAlterTableMutationTest::testBuildCreateTableSqlPreservesNotNullcallsAlterTableMutationTest::testBuildCreateTableSqlPreservesUniqueConstraintscallsAlterTableMutationTest::testBuildCreateTableSqlPreservesUniqueConstraintsAfterAddColumncallsAlterTableMutationTest::testBuildCreateTableSqlSinglePrimaryKeycallsAlterTableMutationTest::testBuildCreateTableSqlUniqueConstraintClosingParenthesisExactcallsAlterTableMutationTest::testBuildCreateTableSqlUniqueConstraintContainsClosingParenthesiscallsAlterTableMutationTest::testBuildCreateTableSqlUniqueConstraintsProducesBacktickedColumnscallsAlterTableMutationTest::testBuildCreateTableSqlUniqueConstraintWrapsBacktickscallsAlterTableMutationTest::testBuildCreateTableSqlUsesTypedColumnNativeTypecallsAlterTableMutationTest::testBuildCreateTableSqlWithCompositePrimaryKeyBacktickscallsAlterTableMutationTest::testChangeColumnNotFoundThrowscallsAlterTableMutationTest::testChangeColumnRenamesAndUpdatesTypecallsAlterTableMutationTest::testChangeColumnSameNameModifiesTypecallsAlterTableMutationTest::testChangeColumnUpdatesStoreColumnKeycallsAlterTableMutationTest::testChangeWithoutColumnKeywordcallsAlterTableMutationTest::testDropColumnNotFoundThrowscallsAlterTableMutationTest::testDropColumnRemovesFromMultipleStoreRowscallsAlterTableMutationTest::testDropColumnRemovesFromStoreDatacallsAlterTableMutationTest::testDropColumnRemovesFromStoreRowscallsAlterTableMutationTest::testDropColumnUpdatesFieldsArrayIndicescallsAlterTableMutationTest::testDropColumnUpdatesFieldsArrayValuescallsAlterTableMutationTest::testDropColumnWithEmptyStorecallsAlterTableMutationTest::testDropColumnWithoutColumnKeywordcallsAlterTableMutationTest::testDropColumnWithoutColumnKeywordRemovesColumncallsAlterTableMutationTest::testDropForeignKeySkippedcallsAlterTableMutationTest::testDropPrimaryKeyRemovesCompositePrimaryKeycallsAlterTableMutationTest::testDropPrimaryKeyRemovesPkFromDefinitioncallsAlterTableMutationTest::testModifyColumnChangesTypecallsAlterTableMutationTest::testModifyColumnNotFoundThrowscallsAlterTableMutationTest::testModifyColumnPreservesOtherColumnTypescallsAlterTableMutationTest::testModifyColumnUpdatesColumnTypeInSchemacallsAlterTableMutationTest::testModifyColumnWithMultipleFieldsOnlyModifiesTargetcallsAlterTableMutationTest::testModifyWithoutColumnKeywordcallsAlterTableMutationTest::testMultipleAlterOperationscallsAlterTableMutationTest::testRenameColumnEmptyStoreDoesNotModifyStorecallsAlterTableMutationTest::testRenameColumnNotFoundThrowscallsAlterTableMutationTest::testRenameColumnUpdatesStoreColumnNamecallsAlterTableMutationTest::testRenameColumnUpdatesStoreDatacallsAlterTableMutationTest::testRenameTableEmptyStoreDoesNotModifyStorecallsAlterTableMutationTest::testRenameTableMovesDataAndRegistrycallsAlterTableMutationTest::testRenameTablePreservesSchemaDefinitioncallsAlterTableMutationTest::testRenameTableTransfersStoreDatacallsAlterTableMutationTest::testRenameTableUnregistersOldNamecallsAlterTableMutationTest::testRenameTableUpdatesRegistryAndStorecallsAlterTableMutationTest::testTableNameReturnsTableNamecallsAlterTableMutationTest::testUnsupportedOperationThrowscalls
Other tests reaching this symbol 10
MySqlSessionFactoryTestcallsMySqlRewriterTest::testAlterTableAddColumnModifiesSchemacallsMySqlRewriterTest::testAlterTableChangeColumnRenamesColumncallsMySqlRewriterTest::testAlterTableDropColumnModifiesSchemacallsMySqlRewriterTest::testAlterTableModifyColumnModifiesSchemacallsMySqlRewriterTest::testAlterTableRenameRenamesTablecallsMySqlRewriterTest::testRewriteAlterTableAddColumnCreatesMutationcallsStatementRewriterTestcallsTableMutationResolverTestcallsMySqlMutationResolverTest::testResolveAlterTableReturnsAlterTableMutationcalls