Django Key (id)=(244584) already exists, Django unique constraint primary key
Updated
•1 min readR
I am software developer based on Kathmandu, Nepal.
Replace stock_price with the table name on which you got the unique constraint issues.
SELECT MAX(id) FROM stock_price;
ALTER SEQUENCE stock_price_id_seq START WITH 245000;
ALTER SEQUENCE stock_price_id_seq RESTART;