From 18e15b44b4dda09f5d5a8a416e3f6524fb8b2a64 Mon Sep 17 00:00:00 2001
From: einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>
Date: Sun, 18 Nov 2007 20:35:31 +0000
Subject: More customer/vendor screen/stored proc fixes.  Note that since
 locations are mapped many<->many with companies and persons, I have moved the
 location class foreign key into the mapping tables.

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

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

diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql
index 67dc0a5a..9737b474 100644
--- a/sql/Pg-database.sql
+++ b/sql/Pg-database.sql
@@ -130,7 +130,6 @@ SELECT SETVAL('location_class_id_seq',4);
   
 CREATE TABLE location (
   id serial PRIMARY KEY,
-  location_class integer not null references location_class(id),
   line_one text check (line_one ~ '[[:alnum:]_]') NOT NULL,
   line_two text,
   line_three text,
@@ -156,6 +155,7 @@ COMMENT ON COLUMN company.tax_id IS $$ In the US this would be a EIN. $$;
 
 CREATE TABLE company_to_location (
   location_id integer references location(id) not null,
+  location_class integer not null references location_class(id),
   company_id integer not null references company(id) ON DELETE CASCADE,
   PRIMARY KEY(location_id,company_id));
 
@@ -201,6 +201,7 @@ create table entity_employee (
 
 CREATE TABLE person_to_location (
   location_id integer not null references location(id),
+  location_class integer not null references location_class(id),
   person_id integer not null references person(id) ON DELETE CASCADE,
   PRIMARY KEY (location_id,person_id));
 
-- 
cgit v1.2.3

