diff options
-rw-r--r-- | sql/Pg-database.sql | 13 |
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, |