Unable to run migrations
I have this small script I'm running to perform the db migrations:
I've made sure the migrationsFolder is the one I want, it has a sql migration file that looks like this (it has more fields ofc):
I get no erros but my db remains the same, you got any ideas ?
5 Replies
I'm using vercel postgres btw
Here is a view from dbeaver after I run the migrations script:
As you can see there are 2 schemas:
1. Public (same with my local db). But it's empty. I would expect the tables to get created.
2. Drizzle. Which has some migrations folders etc, not what Im looking for
HA, I solved it. I just had to delete the "drizzle" schema and the migrations got applied and the "public" schema got its tables created
Now I'm trying to understand why it worked
I think that drizzle keeps track of the applied migrations in your database.
You deleted that table, so drizzle thought it needed to run all migrations
Now, your problem was that somehow the migration was marked as applied but it was not applied.
Sometimes dropping the is a better solution for type of problems
Sounds right to me
Interesting stuff, thanks for the response!