Skip to content

Describe Logic/Rules for changing class hierarchy? #7023

Answered by elprans
lapidus asked this question in Q&A
Discussion options

You must be logged in to vote

Normally changing the object type base results in an ALTER TYPE Foo {EXTENDING NewBase; DROP EXTENDING OldBase}. Like with all ALTER-s objects stay in place, but properties or links might get dropped/added depending on how the layout changed due to the parent object type changes. In this regard, change of type hierarchy is not very different from most type alterations.

However, if the object type changes are so large so that its "similarity" to the original type is very low, the schema diff algorithm might generate a DROP TYPE Foo; CREATE TYPE Foo { ... } sequence, which is where all existing objects would be deleted. This is why edgedb migration create asks the "did you do X" questions t…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by lapidus
Comment options

You must be logged in to vote
1 reply
@elprans
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants