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

Supabase cli cannot load migrations #2357

Closed
mohit2530 opened this issue Jun 1, 2024 · 1 comment
Closed

Supabase cli cannot load migrations #2357

mohit2530 opened this issue Jun 1, 2024 · 1 comment

Comments

@mohit2530
Copy link

Describe the bug
Trying to reset the local db with npx supabase db reset fails with error -

ERROR: duplicate key value violates unique constraint "schema_migrations_pkey" (SQLSTATE 23505)                 
At statement 19: INSERT INTO supabase_migrations.schema_migrations(version, name, statements) VALUES($1, $2, $3)

To Reproduce
Steps to reproduce the behavior:

  1. Open terminal on selected project.
  2. Run command npx supabase db reset
  3. Reset is successful but when after setting up initial schema, error message is seen.

Expected behavior
This should not happen ( I believe ). When we are resetting the database locally, I think the migrations should either be applied or removed.

Screenshots
image

System information
Rerun the failing command with --create-ticket flag.

  • Ticket ID: d5ab641e1e1941469be3d99f64d635cb
  • Version of OS: Windows 11, running on WSL
  • Version of CLI: 1.72.2
  • Version of Docker: Docker version 26.1.2, build 211e74b
  • Versions of services:
    image

Additional context

Node version -
image

@sweatybridge
Copy link
Contributor

How did you generate _load_user_profile migration file? It should not contain any inserts to supabase_migrations.schema_migrations table.

You can fix this error by removing line 19.

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