upgrade-util icon indicating copy to clipboard operation
upgrade-util copied to clipboard

[FIX] util: fix constraint removal in postgres 18

Open Xavier-Do opened this issue 2 months ago • 2 comments

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.

Xavier-Do avatar Oct 09 '25 10:10 Xavier-Do

Pull request status dashboard

robodoo avatar Oct 09 '25 10:10 robodoo

upgradeci retry with always only mail bus

KangOl avatar Oct 09 '25 12:10 KangOl