Task : modification contrainte, manday doit etre>= 0
authorAlicia FLOREZ <alicflorez@gmail.com>
Tue, 26 Mar 2013 10:08:34 +0000 (11:08 +0100)
committerAlicia FLOREZ <alicflorez@gmail.com>
Tue, 26 Mar 2013 10:08:34 +0000 (11:08 +0100)
sql/COPIER_CONTAINERS.SQL
todolist.py

index 075db64..2d02fe0 100644 (file)
@@ -2,16 +2,16 @@ CREATE OR REPLACE FUNCTION copierContainer (id_container todolist_container.id%T
 DECLARE copy_id todolist_container.id%TYPE;
 
 BEGIN
-       INSERT INTO todolist_container (name, description, state) (
-               SELECT 'Copy of ' || name, description, 'draft'
+       INSERT INTO todolist_container (name, description, state, create_uid) (
+               SELECT 'Copy of ' || name, description, 'draft', create_uid
                FROM todolist_container
                WHERE id = id_container
        );
 
        SELECT currval(pg_get_serial_sequence('todolist_container', 'id')) INTO copy_id;
 
-       INSERT INTO todolist_task (name, description, container_id, milestone, planned, manday, priority) (
-               SELECT name, description, copy_id, milestone, planned, manday, priority
+       INSERT INTO todolist_task (name, description, container_id, milestone, planned, manday, priority, create_uid) (
+               SELECT name, description, copy_id, milestone, planned, manday, priority, create_uid
                FROM todolist_task
                WHERE container_id = id_container
        );
index 5d0c666..e1be67c 100644 (file)
@@ -155,7 +155,7 @@ class Task(osv.Model):
         ),
         (
             "manday_sup_0_constraint",
-            "CHECK(manday > 0)",
+            "CHECK(manday >= 0)",
             "The manday should be positive",
         ),
     ]