I'm using a prismia db client with postgresql and I'd like to start auto incrementing an integer field from 0 instead of 1. In other words, how can I write a model so that it starts from 0?
Here's the modal I have.
model SortableItem {
id String @id @default(uuid())
name String
order Int @default(autoincrement())
}
With this implementation, when a record is inserted for the first time, the order starts from 1, but I'd like it to start from 0.
I know postgresql has RESTART to achieve this, but I couldn't find anything equivalent for prisma ORM syntax.
ALTER SEQUENCE tablename_columnname_seq RESTART WITH 0;