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

C(10.4): Duplicate key value violates unique constraint after creating task in DB directly #96

Open
ricayanzon opened this issue Jul 13, 2024 · 0 comments

Comments

@ricayanzon
Copy link
Contributor

ricayanzon commented Jul 13, 2024

Describe the bug
If you create a new instance for one of the tables, e.g. task, in Supabase directly and enter the id manually, the client throws an error when trying to create a new instance with the same id.

Expected behavior
Drizzle or whatever, should recognize that the key exists and skip to the next available id in the sequence.

Additional Notes
Steps to reproduce:

  • Create a new task in the DB directly and set the task_id manually to 1.
  • Switch over to the client and refresh. New task should appear in the UI.
  • Try to create a new task from the interface.
  • On submit, you should see the following error: PostgresError: duplicate key value violates unique constraint "task_pkey"
@ricayanzon ricayanzon changed the title C(10.4): Duplicate key value violates unique constraint when setting task id from Supabase C(10.4): Duplicate key value violates unique constraint after creating task in DB directly Jul 13, 2024
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

1 participant