ID not incremented on MySQL and Postgres
See original GitHub issueWhen you design a new Prisma model for MySQL. The first insert works, the second fail.
UnhandledPromiseRejectionWarning: Error: Error in Photon:
ConnectorError(UniqueConstraintViolation { field_name: "User.id" })
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (10 by maintainers)
Top Results From Across the Web
postgres autoincrement not updated on explicit id inserts
Explicit or not, mysql always update autoincrement pointer based on the max row id. What is the workaround for this problem in postgres?...
Read more >Defining an Auto Increment Primary Key in PostgreSQL - Chartio
Learn how to define an auto increment primary key in PostgreSQL. ... CREATE TABLE books ( id SERIAL PRIMARY KEY, title VARCHAR(100) NOT...
Read more >Reset Auto-Increment IDs in Postgres - Brian Childress
If you've ever needed to “reset” the auto-incrementing row ID in a Postgres database here is a simple command to start fresh (this...
Read more >Prevent Primary Key increment when an INSERT statement ...
As you can see the id is automatically incremented and the name must be unique. Every time I run an INSERT sql statements,...
Read more >PostgreSQL - SERIAL - Generate IDs (Identity, Auto-increment)
When you define a SERIAL column, PostgreSQL automatically changes column to NOT NULL, creates a sequence tablename_serialcol_seq and DEFAULT NEXTVAL to select ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Workaround for now: Manually edit the MySQL column to add auto increment property. Like,
ALTER TABLE <table-name> MODIFY COLUMN <column-name> INT auto_increment
Example,
ALTER TABLE document MODIFY COLUMN document_id INT auto_increment
This is fixed now. Should be available on
alpha
soon.