summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-08-27 05:04:14 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-08-27 05:04:14 +0000
commit1a741102291ad962c47a97ce377c8aa6b96ccbbf (patch)
tree1cfd41eaf9f4ad3e14a71608c43730bf707d29ba
parent6a5ffe52f447695df07100c1af58ef5a103aaf0f (diff)
Applying patch 1780397
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1468 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--sql/Pg-database.sql13
1 files changed, 7 insertions, 6 deletions
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,