How do I mark "migration as applied" after using "push"?

I've been using push for a while, now my migrations don't work anymore because:
[ResponseError: error executing a request on the primary: table `actions` already exists in CREATE TABLE `actions`
[ResponseError: error executing a request on the primary: table `actions` already exists in CREATE TABLE `actions`
6 Replies
Mykhailo
Mykhailo9mo ago
Hello, @cosbgn! Could you clarify your migrations workflow? drizzle-kit push and drizzle-kit generate are different approaches for migrations
cosbgn
cosbgnOP9mo ago
So I used drizzle-kit push for a while since I had to do a lot of migrations now I want to switch to generate Also, with generate will drizzle understand/know different databases (e.g. production vs local) or should I add the whole /migrations folder on .gitignore
Mykhailo
Mykhailo9mo ago
drizzle creates table for migrations, so you don't have to add folder what dialect & driver are you using?
cosbgn
cosbgnOP9mo ago
sqlite/turso
Mykhailo
Mykhailo9mo ago
@cosbgn I reproduced this issue. It is because there is no IF NOT EXISTS. Drizzle kit does not add this statement, that's why migrations try to create again table which already exists. You can manually update migrations to fix this problem. There will be option for this in drizzle-kit in the future
cosbgn
cosbgnOP9mo ago
Thanks
Want results from more Discord servers?
Add your server