Timbolicious
DTDrizzle Team
•Created by Hearse on 11/22/2024 in #help
Local Testing for D1?
Maybe also check this dynamic config for d1 this other thread: https://discord.com/channels/1043890932593987624/1265077849002475571
I have these scripts added to my package.json:
db:local
is needed to create the local DB if it not yet exists in the .wrangler directory
db:reset
is needed to use push
when the table already exists. I don't like this though. Is there another way you know about? Would be nice if push
would use CREATE TABLE IF NOT EXIST
to prevent such errors.11 replies
DTDrizzle Team
•Created by Tom Sherman on 7/22/2024 in #help
D1: `drizzle-kit push` says changes applied but database unchanged
Update: I found a solution yesterday
The problem was, that
push
used the local DB while Drizzle ORM and Studio used the remote DB. That was super confusing.
I found a nice config snippet that I modified slightly:
Then you can specify which DB to use with the CLI by setting the NODE_ENV
environment variable:
Dev (local, default): bun drizzle-kit push
Production (remote): NODE_ENV=production bun drizzle-kit push
(you might need to use crossenv if you're on Windows)4 replies
DTDrizzle Team
•Created by Tom Sherman on 7/22/2024 in #help
D1: `drizzle-kit push` says changes applied but database unchanged
I would love to have
push
working though as migrations are a bit tedious while developing4 replies
DTDrizzle Team
•Created by Tom Sherman on 7/22/2024 in #help
D1: `drizzle-kit push` says changes applied but database unchanged
Hi Tom,
did you ever find a solution to this?
I'm having the same issues right now:
Result: DB is still empty. 😦
But generating a migration and migrating DOES work:
4 replies