GithubHelp home page GithubHelp logo

Comments (4)

encima avatar encima commented on September 26, 2024

This may have happened because the project was restored from a backup but this might be better to open as a Support ticket so you can give the team permission to access your instance and check

from supabase.

MeyerOppelt avatar MeyerOppelt commented on September 26, 2024

As far as I can tell, this looks like normal behavior.

Deleting the migrations table only deletes the index of the applied migrations on the database, just so the database can ignore your old old migrations. Deleting that table would only change the fact that when you run supabase migrations up again, every migration will be pushed, even if it was run in the past.

Effectively this table functions as a history of migrations you have applied in the past, and by deleting it your database can no longer differentiate whether you have already pushed a migration.

Your other issue is that you are restarting the project. I am unsure of if you thought this would delete migrations or reset the database but the restart would only shut down the containers of postgres, gotrue, storage etc. and turn them back on. The main purpose of this is to try and fix issues in the runtime of the postgres instance.

Now if you are trying to reset the database to its original state, the best way is to use the cli and run supabase db reset --linked. This will reset the linked database back to its original state (with some exceptions) and reapply all the migrations in your migrations folder. Fair warning, this will delete all data currently store in your database. This shouldn’t even require a restart of the supabase project and would be available immediately.

If you don’t want your migrations to be reapplied when you run that command, you could try moving the migrations out of the folder, running the command and moving the migrations back. I haven’t tested this but I assume it will work. This would reset the database back to its initial condition without applying your migrations so you have a blank slate to work off of. After that, you can run supabase migrations up whenever you want to push the migrations into the database

from supabase.

MeyerOppelt avatar MeyerOppelt commented on September 26, 2024

Local supabase cant recreate tables without migrations so why remote can?

@Tananga
Local supabase can’t recreate tables because it is not a direct clone of the cloud database. The migrations are run to make the local database a similar clone to the production database, so you can test and develop your system and migration locally before pushing it.

This is why you can run the schema dump, so the first migration to your local database makes it exactly alike the cloud database

from supabase.

Hallidayo avatar Hallidayo commented on September 26, 2024

Hi all, We’re going to close this one due to inactivity. Please feel free to reopen if you’re still having issues here or open a new issue. Thank you.

from supabase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.