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.

Naming the obstacle of adding a primary key columndoctest
$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::PrimaryKeyColumn

Cases§

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
Type declarations 1