Manually create migration file

Is it possible to manually create a migration file like the way prisma has it? basically just creating a sql file that is part of the migration but it does not get executed. I'm asking this because I want to create a migration file for a raw materialized view since views arent supported
8 Replies
Angelelz
Angelelz14mo ago
I'd suggest to create a regular migration with drizzle, maybe change something minor that you know you can change back, and then edit the migration file manually to add what you need before you run it. That way Drizzle marks the migration as completed
imoby
imobyOP14mo ago
thanks. I feel like that might still be a good feature to add where you generate an empty script file but its still in history
Andrii Sherman
Andrii Sherman14mo ago
You can use --custom so it would be drizzle-kit generate:pg --custom in this case you will have an empty sql file created
Angelelz
Angelelz14mo ago
TIL
Andrii Sherman
Andrii Sherman14mo ago
we don't have a lot of words in docs about it
Andrii Sherman
Andrii Sherman14mo ago
No description
imoby
imobyOP14mo ago
thats great! pretty much what I needed. thank you!
Want results from more Discord servers?
Add your server