Prisma migrate dev keeps wanting to drop my sequence
I created an empty migration file, added my sequence in. After that I ran migrate dev which will generate the sql necessary to insert my column
orderNumber Int? @unique @default(dbgenerated("nextval('order_number_seq')"))
It creates the sql for inserting that column
But after running migrate dev again, it keeps creating a new migration with this content
add_sequence.sql migration -
I'm unsure why this is happening1 Reply
Hi @Domica
Can you try doing
prisma db pull
when you work with dbgenerated? This is mentioned in the documentation. You can also take a look at this related issue.GitHub
Prisma migrate incorrectly infers new migration needed when `dbgene...
Bug description Giving a default db generated value with a string in it leads Prisma Migrate to think a new migration is always needed: datasource db { provider = "cockroachdb" // ... } m...
Prisma Schema API | Prisma Documentation
API reference documentation for the Prisma Schema Language (PSL).