Assuming the following data model
model Card {
id Int @id @default(autoincrement())
name String
}
Let's then say I have in the Card table the following
id: 0, name: "0"
id: 1, name: "1"
For some reason, let's say that I have to change id:1 to id:2.
id: 0, name: "0"
id: 2, name: "1"
If I then invoke prisma.card.create(<some info here>...)
, I will get an error like this:
Unhandled Rejection (Error): GraphQL error:
Invalid `prisma.card.create()` invocation:
Unique constraint failed on the fields: (`id`)
Which makes perfect sense. However, is there a way I can make autoincrement skip an existing id? That is, skip to 3 such that:
id: 0, name: "0"
id: 2, name: "1"
id: 3, name: "3"