enumAlterationObstacle
enum AlterationObstacle: string
Public API: explicitly declared with
@visibility public.The reasons SQLite refuses to add or drop a column.
Only the reasons that follow from the statement and the declared columns are modeled; those that need the constraints and indexes of the existing table are not part of a declaration context. Source: https://sqlite.org/lang_altertable.html.
$alter = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('ALTER TABLE t ADD COLUMN id INTEGER PRIMARY KEY');
$alter->facts->diagnostics[0]->obstacle // => \SqlSemantics\Platform\Sqlite\Statement\Schema\Problem\AlterationObstacle::PrimaryKeyColumnCases§
case PrimaryKeyColumn = 'A PRIMARY KEY column cannot be added.'case UniqueColumn = 'A UNIQUE column cannot be added.'case StoredColumn = 'A STORED generated column cannot be added.'case NotNullWithoutDefault = 'A NOT NULL column cannot be added without a default value.'case DefaultNotConstant = 'A column cannot be added with a default value that is not a literal.'case LastColumn = 'The only column of a table cannot be dropped.'Test cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 4
Relations§
Constant reads 6
- class-const SqlSemantics\Platform\Sqlite\Rules\Definition\AlterationProblems::added() packages/sql-semantics-sqlite/src/Rules/Definition/AlterationProblems.php:114
- class-const SqlSemantics\Platform\Sqlite\Rules\Definition\AlterationProblems::added() packages/sql-semantics-sqlite/src/Rules/Definition/AlterationProblems.php:115
- class-const SqlSemantics\Platform\Sqlite\Rules\Definition\AlterationProblems::added() packages/sql-semantics-sqlite/src/Rules/Definition/AlterationProblems.php:116
- class-const SqlSemantics\Platform\Sqlite\Rules\Definition\AlterationProblems::added() packages/sql-semantics-sqlite/src/Rules/Definition/AlterationProblems.php:117
- class-const SqlSemantics\Platform\Sqlite\Rules\Definition\AlterationProblems::added() packages/sql-semantics-sqlite/src/Rules/Definition/AlterationProblems.php:118
- class-const SqlSemantics\Platform\Sqlite\Rules\Definition\AlterationProblems::dropped() packages/sql-semantics-sqlite/src/Rules/Definition/AlterationProblems.php:136