odoo/odoo — pull request #2409 by mart-e (2014-09-15 15:27:50+00:00)
Title: [FIX] base: do not drop sql constraints during update

When a module is updated, the sql constraints were checked against pg_get_constraintdef to see if they have diverged from the one defined in python code.

However this check was failing as the syntax returned by pg_get_constraintdef (e.g. "CHECK ((credit * debit) = 0::numeric)") differs from the one returned by `unify_cons_text` method (e.g. "check(debit*credit = 0")) so the constraints were always dropped and recomputed.
This adds a definition column on ir.model.constraint (storing original definition) to detect changes.