Changing the Column Type to Enum on a model throws an error #17930
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
team/schema
Issue for team Schema.
topic: cockroachdb
topic: enum
"type"/block `enum`
topic: prisma db push
CLI: prisma db push
Milestone
Bug description
When changing a column type from
String
toEnum
on a table (without any data) on CockroachDB throws aError: db error: ERROR: type "{{name of the enum}}" does not exist
For more reference: https://prisma.slack.com/archives/CA491RJH0/p1675847178217929
export DEBUG=*
output:How to reproduce
Videos to Reproduce:
https://prisma.slack.com/archives/CA491RJH0/p1676288645369239?thread_ts=1675847178.217929&cid=CA491RJH0
npx prisma db push
on the givenprisma.schema
filegender
column on model User fromString?
toGender?
enumnpx prisma db push
Expected behavior
Expect the User model to alter the column datatype from String? to Gender? without any errors
Prisma information
// Add your code using Prisma Client
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: