Renaming type A to B fails with `object type B does not exist`
- Gel Version: 6.9+69ad2a3
- Gel CLI Version: Gel CLI 7.7.0+40140c4
- OS Version: macOS Sonoma Version 14.6 (23G80)
I was previously able to rename A to B:
I replaced all instances of A with B in my .gel files, I gel migration create, and it asked me if I renamed A, to which I said yes, and it created something like:
CREATE MIGRATION ...
ONTO ...
{
ALTER TYPE default::A RENAME TO default::B;
};
One of the migration previous to this one started randomly failing, so I re-made the migrations, skipping the failing one.
When reaching the one above, this is what happened:
I replaced all instances of A with B in my .gel files, I gel migration create, and it failed with:
gel error: InvalidReferenceError: object type 'default::B' does not exist
If I manually create the migration to be identical (modulo hashes) to the one above, I get:
gel error: InvalidReferenceError: object type 'default::B' does not exist
gel error: error in one of the migrations
I was not able to replicate this behavior by copy-pasting my default.gel file (and removing references to other .gel files) to a new blank repo and creating a migration before the renaming and one after
Doing the same with all my .gel files without modification lead to a gel error: SchemaDefinitionError: cannot produce migration because of a dependency cycle
(note: A does not appear in that dependency cycle)
I sadly do not have more time to try to minimize this error
Oh I forgot to add, if I change something about type B, on gel migration create I either get the above, or:
did you create object type 'default::B'?
> n // I want to go to the rename prompt
gel error: InvalidReferenceError: object type 'default::B' does not exist
Could you post your schema/migrations, or email them to me at [email protected], with directions to repo?
This seems nasty but there's not really anything I can do with the report as given, unfortunately.
@upview I'll let you look into it