You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the issue, at least on postgres, is actually that there is never any new type creation being done.
On CreateField the pre_statements field is set to None, making it not try to CREATE TYPE, at least in postgres.
Only on CreateModel the pre_statements are generated and evaluated.
so there are two things to fix here:
CreateField is broken with enums (choice), because it never creates the type (also making it not error here for you, since there is no attempt to re-create an existing type)
there should be a proper AlterField or more fine grained alternatives such as AddChoice/RemoveChoice - also so that choice fields are not deleted and recreated in production
As well as arguably DeleteField with choice should probably delete the enum type that was created beforehand.
to work around this while keeping migration-generating capabilities, it would also be nice to be able to create raw SQL statements that set structure_safe, but still have some kind of internal CreateField/DeleteField steps so that the rorm-cli internal model would understand what is being done. (tracking issue: #6)
On postgres:
When adding a new enum variant, the drop column doesn't delete the enum type, so the new creation is ignored
The text was updated successfully, but these errors were encountered: