Is it possible to have @id @default(autoincrement())
with auto-incrementation starting the id
s from 0 instead of 1 ?
In relation to : start ids at an arbitrary number in prisma data model (which did not receive any answer either)
I am interested to see if it is possible with postgresql
in particular.
Prisma generates the corresponding SQL :
CREATE TABLE "Message" (
"id" SERIAL NOT NULL,
"from" TEXT NOT NULL,
"content" TEXT NOT NULL,
"discussionId" INTEGER NOT NULL,
CONSTRAINT "Message_pkey" PRIMARY KEY ("id")
);
Is the NOT NULL
the issue ? Would it be ok to remove it ?
That SO answer seems to at least suggest that it would be possible : https://stackoverflow.com/a/32728273/10469162
And if it's possible, is there a reason for Prisma not to expose it ?