ent
ent copied to clipboard
handle set default + nullable: false better
These forms set or remove the default value for a column. Note that defaults only apply to subsequent INSERT commands; they do not cause rows already in the table to change. Defaults may also be created for views, in which case they are inserted into INSERT statements on the view before the view's ON INSERT rule is applied.
https://www.postgresql.org/docs/7.3/sql-altertable.html
the following steps ends up with a very sad error
- new field nullable
- set default value + nullable: false
we end up with 2 migration files and because postgres doesn't actually change the default values, trying to set value to not null doesn't work, leading to a sad error
local branch error-for-server-default-nullable-false-same-time
https://github.com/lolopinto/ent/issues/1245 is the same thing