Hello, I am having an issue with the following sch...
# prisma-migrate
m
Hello, I am having an issue with the following schema:
Copy code
model User {
  id                 String               @id(map: "PK_cace4a159ff9f2512dd42373760") @default(dbgenerated("gen_random_uuid()")) @db.Uuid
  username           String               @unique(map: "UQ_78a916df40e02a9deb1c4b75edb") @db.VarChar
  email              String?              @unique(map: "UQ_e12875dfb3b1d92d7d7c5377e22") @db.VarChar
  password           String               @db.VarChar

  sheet Sheet[]

  @@index([username], map: "username-idx")
  @@map("user")
}

model Sheet {
  id          String     @id() @default(dbgenerated("gen_random_uuid()")) @db.Uuid
  author      User       @relation(fields: [authorId], references: [id])
  authorId    String     @db.Uuid
  name        String     @unique() @db.VarChar(512)
  slug        String     @unique() @db.VarChar(512)
}
When running
npx prisma migrate dev --name sheets
I get:
Copy code
Migration `20220523212222_sheets` failed to apply cleanly to the shadow database. 
Error:
db error: ERROR: foreign key constraint "Sheet_authorId_fkey" cannot be implemented
DETAIL: Key columns "authorId" and "id" are of incompatible types: text and uuid.
But I thought this line in the Sheet model was correct?
Copy code
authorId    String     @db.Uuid
Deleting the failed migration file did the trick, I'm confused as of how to solve this kind of issue properly when they arise but I'm at least unstuck now