Drizzle Push to Turso fails on third attempt

If I use drizzle push on an empty turso db the first push works fine. (command: "pnpm db:push") After that if I run push again, it thinks that the schema doesn't match and it applies some changes. On the third db:push attempt it tries to do the changes again but this time it fails and it leaves the db in an "broken" state. (Because It has some _old tables left and the new ones are missing the values of the _old one.) I see two issues here. 1) Drizzle kit sees schema changes which are actually not there. 2) Drizzle kit is not pushing in a transaction and on error it is not getting rolled back Does anybody else have this issue / a solution? Here is a link to a minimal repo: https://github.com/Cuhadari-Deniz/testing-drizzle-turso drizzle-orm: 0.30.10 drizzle-kit: 0.21.4 @libsql/client: 0.6.0
GitHub
GitHub - Cuhadari-Deniz/testing-drizzle-turso
Contribute to Cuhadari-Deniz/testing-drizzle-turso development by creating an account on GitHub.
2 Replies
Mykhailo
Mykhailo4mo ago
Hey @Dari. The problem lies with your schema. You should change current_timestamp to (current_timestamp) and reset your database
Dari
Dari4mo ago
Wow that solved it. Thank you very much!
Want results from more Discord servers?
Add your server