From 1a741102291ad962c47a97ce377c8aa6b96ccbbf Mon Sep 17 00:00:00 2001 From: einhverfr Date: Mon, 27 Aug 2007 05:04:14 +0000 Subject: Applying patch 1780397 git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1468 4979c152-3d1c-0410-bac9-87ea11338e46 --- sql/Pg-database.sql | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'sql') diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql index 57594e4a..8d22a0cb 100644 --- a/sql/Pg-database.sql +++ b/sql/Pg-database.sql @@ -94,7 +94,7 @@ CREATE FUNCTION lock_record (int, int) returns bool as $$ declare locked int; -begin; +begin SELECT locked_by into locked from transactions where id = $1; IF NOT FOUND THEN RETURN FALSE; @@ -430,6 +430,12 @@ ALTER TABLE invoice_note ADD FOREIGN KEY (ref_key) REFERENCES invoice(id); -- +-- pricegroup added here due to references +CREATE TABLE pricegroup ( + id serial PRIMARY KEY, + pricegroup text +); + CREATE TABLE entity_credit_account ( id serial not null unique, entity_id int not null references entity(id) ON DELETE CASCADE, @@ -897,11 +903,6 @@ CREATE TABLE partsvendor ( entry_id SERIAL PRIMARY KEY ); -- -CREATE TABLE pricegroup ( - id serial PRIMARY KEY, - pricegroup text -); --- CREATE TABLE partscustomer ( parts_id int, customer_id int not null references entity_credit_account(id) on delete cascade, -- cgit v1.2.3