[FEATURE]: drizzle-seed should support automatically resetting and pushing a new schema. #4171
Open
1 task done
Labels
enhancement
New feature or request
Feature hasn't been suggested before.
Describe the enhancement you want to request
I want to be able to reset the database, push a new schema and seed it with new values. I'd expect this to work with simply calling
reset()
and then pushing database viaexecSync('npx drizzle-kit push --force')
.However, when a table is renamed(or some other schema change) and I want to call the script above to push new schema and re-seed, reset throws an error.
Moreover, sometimes for some other schema changes (like renaming an enum, renaming a column and changing its type) doing reset works, pushing schema --force(via code) right after works, but these schema changes aren't reflected.
Right now I'm doing this hack to get around this issue:
I believe drizzle-seed should support this out of the box.
The text was updated successfully, but these errors were encountered: