diff options
Diffstat (limited to 'doc/howtos/backend/exercise-constraint-sql')
| -rw-r--r-- | doc/howtos/backend/exercise-constraint-sql | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/doc/howtos/backend/exercise-constraint-sql b/doc/howtos/backend/exercise-constraint-sql deleted file mode 100644 index 5595a6db3c6..00000000000 --- a/doc/howtos/backend/exercise-constraint-sql +++ /dev/null @@ -1,24 +0,0 @@ -# HG changeset patch -# Parent 121bbfe120be3007f5e04611dbc27038abafcce8 - -Index: addons/openacademy/models.py -=================================================================== ---- addons.orig/openacademy/models.py -+++ addons/openacademy/models.py -@@ -14,6 +14,16 @@ - session_ids = fields.One2many( - 'openacademy.session', 'course_id', string="Sessions") - -+ _sql_constraints = [ -+ ('name_description_check', -+ 'CHECK(name != description)', -+ "The title of the course should not be the description"), -+ -+ ('name_unique', -+ 'UNIQUE(name)', -+ "The course title must be unique"), -+ ] -+ - - class Session(models.Model): - _name = 'openacademy.session' |
