edgedb
edgedb copied to clipboard
Migrations can't change a pointer's type while rebasing it
In the test test_edgeql_migration_reject_prop_05, we try to do the migration
scalar type Slug extending str;
abstract type Named {
required property name -> Slug;
};
type User {
required property name -> str;
};
to
scalar type Slug extending str;
abstract type Named {
required property name -> Slug;
};
type User extending Named;
The initial migration proposed is the somewhat dubious "drop name, recreate it", which has the virtue of at least successfully applying.
If we reject that, though, and ask to keep the existing name, we generate a migration that tries to rebase User onto Named and then set the type of name. This doesn't work, since the rebase fails due to the type conflict.
To make this work, we need to generate a SET TYPE that goes before the rebase to make the types match up before the rebase can happen. I think this might require drawing some more distinctions in ordering, since I think normally we try to put changes after a rebase.