Skip to content

Make the reset command apply the last migrations#95

Closed
erwanMarmelab wants to merge 2 commits into
mainfrom
improve_migration_make_command
Closed

Make the reset command apply the last migrations#95
erwanMarmelab wants to merge 2 commits into
mainfrom
improve_migration_make_command

Conversation

@erwanMarmelab

Copy link
Copy Markdown
Contributor

Problem

When I reset my database, the last migrations are not applied.

Solution

Use the migration command on database reset

Comment thread makefile Outdated
npx supabase migration up

supabase-reset-database: ## reset (and clear!) the database
$(MAKE) supabase-migrate-database

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't you inverse the order? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not, both works. Applied

Comment thread makefile
Comment on lines 18 to +20
supabase-reset-database: ## reset (and clear!) the database
npx supabase db reset
$(MAKE) supabase-migrate-database

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have doubts this is really needed.
According the the docs, it should already apply migrations at this stage:

Recreates the local Postgres container and applies all local migrations found in supabase/migrations directory

Can you double check?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be needed. The supabase db reset command apply all migrations

@erwanMarmelab erwanMarmelab deleted the improve_migration_make_command branch April 7, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants