I was trying to split a flat collection that contains a SELECT field into a collection with two tabs.
If there is already data in the database, the migration fails and also hangs the server with a node error because of the select field.
I get asked to rename the columns of the collection one by one to reflect the fields being nested inside tabs now but the SELECT field cannot be renamed if it already has data in its column. Postgres won't allow the rename because of the ENUM constraint.
Expected behavior
The rename column wizard should be able to rename ENUM columns without problem even if it has to truncate the table.
Environment & setup
Make sure to have the postgres version of payload installed with a local postgres db
Create a flat collection that contains a select field
Populate a few records in this collection via the admin UI
Now change the schema of the collection to split fields into two tabs (using tab fields)
Payload now should ask you to rename db columns via the CLI
Accept column renames and you will get a postgres migration error because of the ENUM column constraint not being resolved (even if you accept data loss)
What version of
drizzle-orm
are you using?0.28.5
What version of
drizzle-kit
are you using?0.19.13-e99bac1
Describe the Bug
I'm using Payload
https://payloadcms.com/
I was trying to split a flat collection that contains a SELECT field into a collection with two tabs. If there is already data in the database, the migration fails and also hangs the server with a node error because of the select field.
I get asked to rename the columns of the collection one by one to reflect the fields being nested inside tabs now but the SELECT field cannot be renamed if it already has data in its column. Postgres won't allow the rename because of the ENUM constraint.
Expected behavior
The rename column wizard should be able to rename ENUM columns without problem even if it has to truncate the table.
Environment & setup