Hello everyone. So I have the following schema: ``...
# prisma-migrate
j
Hello everyone. So I have the following schema:
Copy code
model Account {
  id                  String  @id @default(dbgenerated("my_schema.uuid_generate_v4()")) @db.Uuid
  ...

  @@map(name: "accounts")
}

model Product {
  id          String          @id @default(dbgenerated("my_schema.uuid_generate_v4()")) @db.Uuid
  ...

  @@map(name: "products")
}
Every time I create or apply a migration Prisma generates the alter for the id columns despite the fact that those columns did not change:
Copy code
-- AlterTable
ALTER TABLE "accounts" ALTER COLUMN "id" SET DEFAULT my_schema.uuid_generate_v4();

-- AlterTable
ALTER TABLE "products" ALTER COLUMN "id" SET DEFAULT my_schema.uuid_generate_v4();
Is this a bug? Am I doing something wrong here? Environment: prisma ^2.24.1 PostgreSQL 13.2 Thanks in advance for your help 🙂
d
Hey @Jesús Quirós, That looks like a bug. Could you please open an issue for this so that the engineering team can take a look at this?
t
Hi @Jesús Quirós — I was intrigued so I tried to reproduce the problem in a test and couldn't see that behaviour. After the first migration, the schema is up to date and no second migration is created. You can see the test here: https://github.com/prisma/prisma-engines/pull/2009/files#diff-b093029e9613608b60e6210edced244a0597dd326ff81d63ef1cd6535f318d16R195 More details on your setup, your migrations, etc. in an issue may be helupful.
j
Hey @Daniel Norman, I opened the issue: https://github.com/prisma/prisma/issues/7592. Thanks for all the help 👍
👍 1