After updating to preview 22 and migrating the DB, everything worked fine. But then when I changed one enum it started failing.
Migrations now contain TestStatus_new which I guess is used to migrate the enum from TestStatus. But it contains it even though I deleted all tables from the DB and migrations too
ERROR Oops, an unexpected error occured!
Failure during a migration command: Connector error. (error: Error queryin
g the database: Error querying the database: Error querying the database:
db error: ERROR: type "TestStatus_new" already exists)
UPDATE: Deleting the whole DB helps
I can confirm this bug. I would guess that we are somehow using the old migrate logic even after updating the enum implementation to use native database types.
Steps to reproduce:
generator client {
provider = "prisma-client-js"
}
enum Permissions {
ADMIN
USER
}
model User {
id String @id @default(cuid())
name String
permission Permissions[]
}
```
prisma2 studio --experimental. Make sure at least one row uses the USER enumgenerator client {
provider = "prisma-client-js"
}
enum Permissions {
ADMIN
ASSOCIATE
}
model User {
id String @id @default(cuid())
name String
permission Permissions[]
}
```
It should throw the following Rust panic:

Version: [email protected], binary version: 687716d3305368e3f586f8957de2037fd8a50f8f
Is there a workaround for this?
Can someone suggests some fix for this problem? instead of deleting the whole DB... (but yeah delete the whole DB works for me)
@shixian-hf run DROP SCHEMA public CASCADE
Duplicate of #414
Most helpful comment
I can confirm this bug. I would guess that we are somehow using the old migrate logic even after updating the enum implementation to use native database types.
Steps to reproduce:
```prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
prisma2 studio --experimental. Make sure at least one row uses theUSERenum```prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
```
It should throw the following Rust panic:

Version:
[email protected], binary version: 687716d3305368e3f586f8957de2037fd8a50f8f