There is no reason for the parent id being NOT NULL.
authorJan Schneider <jan@horde.org>
Thu, 22 Oct 2009 14:21:10 +0000 (16:21 +0200)
committerJan Schneider <jan@horde.org>
Thu, 22 Oct 2009 14:22:19 +0000 (16:22 +0200)
nag/lib/Driver.php
nag/lib/Driver/Kolab.php
nag/lib/Driver/Sql.php
nag/scripts/sql/nag.mssql.sql
nag/scripts/sql/nag.oci8.sql
nag/scripts/sql/nag.sql
nag/scripts/sql/nag.xml
nag/scripts/upgrades/2.1_to_2.2.oci8.sql
nag/scripts/upgrades/2.1_to_2.2.sql
nag/scripts/upgrades/2007-05-16_sub_tasks.sql

index 0dba8a0..2431c75 100644 (file)
@@ -218,8 +218,8 @@ class Nag_Driver
         }
 
         $taskId = $this->_add($name, $desc, $start, $due, $priority, $estimate,
-                              $completed, $category, $alarm, $methods, $uid, $parent,
-                              $private, $owner, $assignee);
+                              $completed, $category, $alarm, $methods, $uid,
+                              $parent, $private, $owner, $assignee);
         if (is_a($taskId, 'PEAR_Error')) {
             return $taskId;
         }
index e3f46ee..070f4f0 100644 (file)
@@ -100,7 +100,7 @@ class Nag_Driver_Kolab extends Nag_Driver
      * @param integer $alarm      The alarm associated with the task.
      * @param array $methods      The overridden alarm notification methods.
      * @param string $uid         A Unique Identifier for the task.
-     * @param string $parent      The parent task.
+     * @param string $parent      The parent task id.
      * @param boolean $private    Whether the task is private.
      * @param string $owner       The owner of the event.
      * @param string $assignee    The assignee of the event.
@@ -133,7 +133,7 @@ class Nag_Driver_Kolab extends Nag_Driver
      * @param integer $alarm           The alarm associated with the task.
      * @param array $methods           The overridden alarm notification
      *                                 methods.
-     * @param string $parent           The parent task.
+     * @param string $parent           The parent task id.
      * @param boolean $private         Whether the task is private.
      * @param string $owner            The owner of the event.
      * @param string $assignee         The assignee of the event.
@@ -368,7 +368,7 @@ class Nag_Driver_kolab_wrapper_old extends Nag_Driver_kolab_wrapper {
      * @param integer $completed       The completion state of the task.
      * @param string $category         The category of the task.
      * @param integer $alarm           The alarm associated with the task.
-     * @param string $parent           The parent task.
+     * @param string $parent           The parent task id.
      * @param boolean $private         Whether the task is private.
      * @param string $owner            The owner of the event.
      * @param string $assignee         The assignee of the event.
@@ -422,7 +422,7 @@ class Nag_Driver_kolab_wrapper_old extends Nag_Driver_kolab_wrapper {
      * @param string $category    The category of the task.
      * @param integer $alarm      The alarm associated with the task.
      * @param string $uid         A Unique Identifier for the task.
-     * @param string $parent      The parent task.
+     * @param string $parent      The parent task id.
      * @param boolean $private    Whether the task is private.
      * @param string $owner       The owner of the event.
      * @param string $assignee    The assignee of the event.
@@ -463,7 +463,7 @@ class Nag_Driver_kolab_wrapper_old extends Nag_Driver_kolab_wrapper {
      * @param integer $completed       The completion state of the task.
      * @param string $category         The category of the task.
      * @param integer $alarm           The alarm associated with the task.
-     * @param string $parent           The parent task.
+     * @param string $parent           The parent task id.
      * @param boolean $private         Whether the task is private.
      * @param string $owner            The owner of the event.
      * @param string $assignee         The assignee of the event.
@@ -769,7 +769,7 @@ class Nag_Driver_kolab_wrapper_new extends Nag_Driver_kolab_wrapper {
      * @param string $category         The category of the task.
      * @param integer $alarm           The alarm associated with the task.
      * @param string $uid              A Unique Identifier for the task.
-     * @param string $parent           The parent task.
+     * @param string $parent           The parent task id.
      * @param boolean $private         Whether the task is private.
      * @param string $owner            The owner of the event.
      * @param string $assignee         The assignee of the event.
@@ -793,7 +793,7 @@ class Nag_Driver_kolab_wrapper_new extends Nag_Driver_kolab_wrapper {
         }
 
         if ($parent) {
-            list($parent, $dummy) = $this->_splitId($parent);
+            list($parent,) = $this->_splitId($parent);
         }
 
         if ($private) {
@@ -844,7 +844,7 @@ class Nag_Driver_kolab_wrapper_new extends Nag_Driver_kolab_wrapper {
      * @param string $category         The category of the task.
      * @param integer $alarm           The alarm associated with the task.
      * @param string $uid              A Unique Identifier for the task.
-     * @param string $parent           The parent task.
+     * @param string $parent           The parent task id.
      * @param boolean $private         Whether the task is private.
      * @param string $owner            The owner of the event.
      * @param string $assignee         The assignee of the event.
@@ -875,7 +875,7 @@ class Nag_Driver_kolab_wrapper_new extends Nag_Driver_kolab_wrapper {
      * @param integer $completed       The completion state of the task.
      * @param string $category         The category of the task.
      * @param integer $alarm           The alarm associated with the task.
-     * @param string $parent           The parent task.
+     * @param string $parent           The parent task id.
      * @param boolean $private         Whether the task is private.
      * @param string $owner            The owner of the event.
      * @param string $assignee         The assignee of the event.
index f2ac012..3ad3cc9 100644 (file)
@@ -154,7 +154,7 @@ class Nag_Driver_Sql extends Nag_Driver {
      * @param integer $alarm      The alarm associated with the task.
      * @param array $methods      The overridden alarm notification methods.
      * @param string $uid         A Unique Identifier for the task.
-     * @param string $parent      The parent task.
+     * @param string $parent      The parent task id.
      * @param boolean $private    Whether the task is private.
      * @param string $owner       The owner of the event.
      * @param string $assignee    The assignee of the event.
@@ -194,7 +194,7 @@ class Nag_Driver_Sql extends Nag_Driver {
                         (int)$alarm,
                         serialize(Horde_String::convertCharset($methods, Horde_Nls::getCharset(), $this->_params['charset'])),
                         (int)$private,
-                        Horde_String::convertCharset($parent, Horde_Nls::getCharset(), $this->_params['charset']));
+                        $parent);
 
         /* Log the query at a DEBUG log level. */
         Horde::logMessage(sprintf('Nag_Driver_Sql::_add(): %s', $query),
@@ -227,7 +227,7 @@ class Nag_Driver_Sql extends Nag_Driver {
      * @param integer $alarm           The alarm associated with the task.
      * @param array $methods           The overridden alarm notification
      *                                 methods.
-     * @param string $parent           The parent task.
+     * @param string $parent           The parent task id.
      * @param boolean $private         Whether the task is private.
      * @param string $owner            The owner of the event.
      * @param string $assignee         The assignee of the event.
@@ -270,7 +270,7 @@ class Nag_Driver_Sql extends Nag_Driver {
                         Horde_String::convertCharset($category, Horde_Nls::getCharset(), $this->_params['charset']),
                         (int)$alarm,
                         serialize(Horde_String::convertCharset($methods, Horde_Nls::getCharset(), $this->_params['charset'])),
-                        Horde_String::convertCharset($parent, Horde_Nls::getCharset(), $this->_params['charset']),
+                        $parent,
                         (int)$private,
                         $this->_tasklist,
                         $taskId);
index 8165a76..d3d006b 100644 (file)
@@ -2,7 +2,7 @@ CREATE TABLE nag_tasks (
     task_id              VARCHAR(32) NOT NULL,
     task_owner           VARCHAR(255) NOT NULL,
     task_creator         VARCHAR(255) NOT NULL,
-    task_parent          VARCHAR(255) NOT NULL,
+    task_parent          VARCHAR(255),
     task_assignee        VARCHAR(255),
     task_name            VARCHAR(255) NOT NULL,
     task_uid             VARCHAR(255) NOT NULL,
index facb589..96ae114 100644 (file)
@@ -2,7 +2,7 @@ CREATE TABLE nag_tasks (
     task_id              VARCHAR2(32) NOT NULL,
     task_owner           VARCHAR2(255) NOT NULL,
     task_creator         VARCHAR2(255) NOT NULL,
-    task_parent          VARCHAR2(255) NOT NULL,
+    task_parent          VARCHAR2(255),
     task_assignee        VARCHAR2(255),
     task_name            VARCHAR2(255) NOT NULL,
     task_uid             VARCHAR2(255) NOT NULL,
index 6a12c4e..cd7520a 100644 (file)
@@ -2,7 +2,7 @@ CREATE TABLE nag_tasks (
     task_id              VARCHAR(32) NOT NULL,
     task_owner           VARCHAR(255) NOT NULL,
     task_creator         VARCHAR(255) NOT NULL,
-    task_parent          VARCHAR(255) NOT NULL,
+    task_parent          VARCHAR(255),
     task_assignee        VARCHAR(255),
     task_name            VARCHAR(255) NOT NULL,
     task_uid             VARCHAR(255) NOT NULL,
index ab80161..3a6fe47 100644 (file)
@@ -36,7 +36,6 @@
     <name>task_parent</name>
     <type>text</type>
     <length>32</length>
-    <notnull>true</notnull>
    </field>
 
    <field>
index 82ffc26..7ad1f5e 100644 (file)
@@ -1,9 +1,7 @@
 ALTER TABLE nag_tasks ADD task_estimate FLOAT;
 ALTER TABLE nag_tasks ADD task_completed_date NUMBER(16);
 ALTER TABLE nag_tasks ADD task_start NUMBER(16);
-ALTER TABLE nag_tasks ADD task_parent VARCHAR2(32) DEFAULT '';
-UPDATE nag_tasks SET task_parent = '';
-ALTER TABLE nag_tasks MODIFY (task_parent NOT NULL);
+ALTER TABLE nag_tasks ADD task_parent VARCHAR2(32);
 
 CREATE INDEX nag_start_idx ON nag_tasks (task_start);
 
index 36daff5..70eaea8 100644 (file)
@@ -1,7 +1,7 @@
 ALTER TABLE nag_tasks ADD task_estimate FLOAT;
 ALTER TABLE nag_tasks ADD task_completed_date INT;
 ALTER TABLE nag_tasks ADD task_start INT;
-ALTER TABLE nag_tasks ADD task_parent VARCHAR(32) DEFAULT '' NOT NULL;
+ALTER TABLE nag_tasks ADD task_parent VARCHAR(32);
 
 CREATE INDEX nag_start_idx ON nag_tasks (task_start);
 
index 63188a1..14b7108 100644 (file)
@@ -1 +1 @@
-ALTER TABLE nag_tasks ADD task_parent VARCHAR(32) DEFAULT '' NOT NULL;
+ALTER TABLE nag_tasks ADD task_parent VARCHAR(32);