odoo/upgrade-util#337

Created by Framework (ORM), Xavier Dollé (xdo)

Blocked

label
odoo-dev:master-fix-postgres-18-xdo
head
4ee367dbdff0063a933ade9d8c07afae1a5ee735
odoo/upgrade-util
master #337 missing r+

[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.