Repository navigation
fix: an alter the provider writes as drop and add is a dropped column, and an extension an object comes to need is ensured - #87
Merged
Conversation
…, and an extension an object comes to need is ensured Closes #80. Closes #81. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #80
Closes #81
Both come from one assumption: that an
AlterColumnOperationleaves what reads the column alone.Problem
#80, silent. Npgsql and SQL Server write
DROP COLUMNandADD COLUMNfor an alter whoseComputedColumnSqlorIsStoredchanged. The kernel saidColumnAltered, the exclusion contributor answeredUnaffected, and PostgreSQL dropped the constraint with its element column without a word. The migration applied, the constraint was gone, and the model against its snapshot diffed to nothing, so no later migration put it back.#81, loud. A column type change that begins the need for
btree_gist(ltreetotext) created nothing, so no extension was ensured, while PostgreSQL rebuilt the constraint's index under the new type:42704: data type text has no default operator class for access method "gist". A test of mine pinned that migration as right.Change
BaseChanges.DroppedAndAdded: an alter the provider writes as drop and add becomesColumnDropped. The rule is the two generators' own condition, plus Npgsql's generatedtsvector, whose computation it derives from two annotations. Contributors then answer as for a drop:Lostfor an element column (the constraint is added again after),RebuildAroundfor a column only the condition reads (2BP01 otherwise).CREATE EXTENSION.design/schemakit-core-plan.md, section 3.7: a computed column is no longer "not measured".Decisions to confirm
ColumnDropped, not a new case ofBaseChange. To what reads the column the two are the same event, and the union stays as it is.Found on the way
tsvectorannotations into a computation and removes one. A test that asked the kernel's rule after generating read the generator's answer back. That is how the one surviving mutation was found.texttoltreedoes not apply at all, with or without a constraint: PostgreSQL casts no text to ltree by itself (42804). Npgsql's statement, not SchemaKit's.Tests
451 kernel, 64 PostgreSQL offline, 28 live on PostgreSQL 16.15 and 18.6, 125 probes.
DROP COLUMN. SQL Server's is read from its generator's text, not run.ColumnDropped, on Npgsql and SQL Server. An extension an object comes to depend on is ensured with nothing created; not the other way round, not when both sides have it.EnsureCreated()builds. The migration of A column type change that begins the need for btree_gist fails to apply, and a test pins it as right #81 applies on a database withoutbtree_gist.Each guard shown to fail, in a scratch copy:
tsvectorannotations not looked atA_type_change_…_brings_the_extension_it_begins_to_need, the kernel's, liveA_type_change_that_begins_the_need_for_the_extension_applies🤖 Generated with Claude Code