Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Constraint fails when I try to save model on Admin Panel #235

Open
Alihassanc5 opened this issue Jun 18, 2024 · 1 comment
Open

Comments

@Alihassanc5
Copy link

I am getting this error when I change the tenant and save the model through admin panel:

image

How can I resolve this error?

@andyp05
Copy link

andyp05 commented Jun 18, 2024

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants