m&tra
DTDrizzle Team
•Created by cvr on 7/4/2023 in #help
How to set a default timestamp_ms for sqlite
@IP @cvr @dandadan I was using IP's solution with a $default arrow function in my schema.ts returning
new Date()
, but the generated migration files didn't have SQL-defined DEFAULTs.
I found a solution that sets the SQL default and works with SQLite, returning the same timestamp format as new Date():
16 replies
DTDrizzle Team
•Created by m&tra on 1/20/2024 in #help
Creating triggers with SQLite
FWIW, I did make a working trigger function using a transaction:
10 replies
DTDrizzle Team
•Created by m&tra on 1/20/2024 in #help
Creating triggers with SQLite
Ty @Angelelz !
10 replies
DTDrizzle Team
•Created by m&tra on 1/20/2024 in #help
Creating triggers with SQLite
It works now... my migration script was pointing to the wrong DB this whole time
10 replies
DTDrizzle Team
•Created by m&tra on 1/20/2024 in #help
Creating triggers with SQLite
I've tried doing this, but it doesn't seem to work--maybe I'm doing something wrong. This is what I'm adding to the end of my migration file:
After adding this, I just
npm exec drizzle-kit push:sqlite
to apply?10 replies