From 6834bed0070192ee78e7b4056e72f94e37b46162 Mon Sep 17 00:00:00 2001
From: tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>
Date: Thu, 29 Nov 2007 20:26:55 +0000
Subject: Adjusting the schema to account for recurring(print|email) and status
 having multicolumn primary keys

git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1922 4979c152-3d1c-0410-bac9-87ea11338e46
---
 sql/Pg-database.sql | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

(limited to 'sql/Pg-database.sql')

diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql
index 96dea912..3e51a356 100644
--- a/sql/Pg-database.sql
+++ b/sql/Pg-database.sql
@@ -850,11 +850,12 @@ CREATE TABLE partsgroup (
 );
 --
 CREATE TABLE status (
-  trans_id int PRIMARY KEY,
+  trans_id int,
   formname text,
   printed bool default 'f',
   emailed bool default 'f',
-  spoolfile text
+  spoolfile text,
+  PRIMARY KEY (trans_id, formname)
 );
 --
 CREATE TABLE department (
@@ -978,17 +979,19 @@ CREATE TABLE recurring (
 );
 --
 CREATE TABLE recurringemail (
-  id int PRIMARY KEY,
+  id int,
   formname text,
   format text,
-  message text
+  message text,
+  PRIMARY KEY (id, formname)
 );
 --
 CREATE TABLE recurringprint (
-  id int PRIMARY KEY,
+  id int,
   formname text,
   format text,
-  printer text
+  printer text,
+  PRIMARY KEY (id, formname)
 );
 --
 CREATE TABLE jcitems (
@@ -1696,7 +1699,7 @@ CREATE TABLE menu_node (
 );
 
 
-ALTER TABLE public.menu_node OWNER TO ledgersmb;
+--ALTER TABLE public.menu_node OWNER TO ledgersmb;
 
 --
 -- Name: menu_node_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ledgersmb
@@ -2631,7 +2634,7 @@ CREATE VIEW menu_friendly AS
     SELECT t."level", t.path, t.list_order, (repeat(' '::text, (2 * t."level")) || (n.label)::text) AS label, n.id, n."position" FROM (connectby('menu_node'::text, 'id'::text, 'parent'::text, 'position'::text, '0'::text, 0, ','::text) t(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node n USING (id));
 
 
-ALTER TABLE public.menu_friendly OWNER TO ledgersmb;
+--ALTER TABLE public.menu_friendly OWNER TO ledgersmb;
 
 --
 -- PostgreSQL database dump complete
-- 
cgit v1.2.3

