upgrade-util
upgrade-util copied to clipboard
[FIX] util: fix constraint removal in postgres 18
Since postgres 18 the not null on a field is an explicit constraint named tablename_colname_not_null. When trying to drop all constraint from a model, an error occurs when trying to drop the id primary key not null constraint.
ALTER TABLE "mail_presence" DROP CONSTRAINT IF EXISTS "bus_presence_id_not_null"
ERROR: column "id" is in a primary key
This commit filters the constraints to remove the id not null one.
We may want to make this filter generic on all not null constraint.
upgradeci retry with always only mail bus
