How can I get warning when creating "Migration" with non nullable field
When I generate migration using the command
drizzle-kit generate --config ./drizzle.config.ts
I don't get any warnings for new fields that is non nullable. Shouldn't it warn me or ask for a default value?
The generated SQL:
Config has these options
4 Replies
I guess there isn't any option 😔
Why would it warn u? It's totally fine to have a field not null without a default
If u want to enforce something to be not null, but still dont want a default value how would you do it otherwsie?
It's quite common scenario
@DoggeSlapper but old profiles can't have non nullable field
so, it will not migrate
Ah I get what u want to do. I guess you need to use a custom migration and alter name of the column then move back
or u delete all nulls
I dont see how dirzzle could handle this automatically