Duplicate Constraint fails when I try to save model on Admin Panel
Alihassanc5 opened this issue · 1 comments
Alihassanc5 commented
andyp05 commented
Check to make sure the postgresql sequence that was created to add an ID for that table is set correctly and the next ID is Max(id)+1
Or it could be that you tried to update the id manually.
You can reset it using the following:
SELECT setval('tablename_id_seq', (SELECT COALESCE(max(id),0)+1 FROM "tablenames"), false);