Postgres migrations doesn't apply automatically when starting local development environment #2560
-
I just tried to ask a colleague to boot our project locally and migrations were not installed automatically. Even we have them committed to the repository (in By default, we don't have any tables under the Here's an example of our very first migration: # nhost/migrations/default/1708719143789_create_problems/up.sql
CREATE TABLE public.problems (
id UUID DEFAULT gen_random_uuid() NOT NULL,
body TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT now() NOT NULL,
PRIMARY KEY (id)
); Here are the steps taken:
All services started, but the following info has been logged in to console: Applying migrations...
INFO nothing to apply on database: default When opening Dashboard > Database > schema.public: Trying fresh setup myselfWhen I try to simulate the fresh setup flow myself, the same happens. Here's what I do to simulate it:
All services start successfully, but migrations are not applied > no tables under Applying migrations...
INFO nothing to apply on database: default Not sure what to do, but I need a fully working local environment for peers, too. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Maybe already applied migrations are stored somewhere outside of the project dir and I have to delete that record? 🤷♂️ |
Beta Was this translation helpful? Give feedback.
Migrations are always applied. If it says there is nothing to apply that might mean they have already been applied. If needed, you can "reset" your local environment with
nhost down --volumes && rm -rf .nhost
. You can also check your migrations with the following command:(you may need to change the admin secret)
If you still don't find the issue, please, provide a github repository reproducing the issue so we can take a look.