From ff7600b046d773a20bf843995806d5dccc86af46 Mon Sep 17 00:00:00 2001 From: idfx Date: Tue, 30 Sep 2003 19:32:42 +0000 Subject: [PATCH] to_parent aatribute without NOT NULL and DEFAULT value. Needed for parent-child-relation --- dbscripts/create_pg.sql | 2 +- dbscripts/updates/update20030920.sql | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 dbscripts/updates/update20030920.sql diff --git a/dbscripts/create_pg.sql b/dbscripts/create_pg.sql index d9ce6ab8..5dcdbc72 100755 --- a/dbscripts/create_pg.sql +++ b/dbscripts/create_pg.sql @@ -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 index 00000000..503687d8 --- /dev/null +++ b/dbscripts/updates/update20030920.sql @@ -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; + -- 2.11.0