to_parent aatribute without NOT NULL and DEFAULT value. Needed for parent-child-relation
authoridfx <idfx>
Tue, 30 Sep 2003 19:32:42 +0000 (19:32 +0000)
committeridfx <idfx>
Tue, 30 Sep 2003 19:32:42 +0000 (19:32 +0000)
dbscripts/create_pg.sql
dbscripts/updates/update20030920.sql [new file with mode: 0755]

index d9ce6ab..5dcdbc7 100755 (executable)
@@ -105,7 +105,7 @@ CREATE SEQUENCE "topic_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue
 
 CREATE TABLE "topic" (
        "id" integer DEFAULT nextval('topic_id_seq'::text) NOT NULL,
-       "parent_id" integer DEFAULT '0' NOT NULL,
+       "parent_id" integer,
        "title" character varying(80) NOT NULL,
        "description" text,
        "filename" character varying(20) NOT NULL,
diff --git a/dbscripts/updates/update20030920.sql b/dbscripts/updates/update20030920.sql
new file mode 100755 (executable)
index 0000000..503687d
--- /dev/null
@@ -0,0 +1,5 @@
+-- parent_id should not NOT NULL and should not have a DEFAULT 
+
+ALTER TABLE topic ALTER parent_id DROP NOT NULL;
+ALTER TABLE topic ALTER parent_id DROP DEFAULT;
+