diff --git a/hsarback/database/data.sql b/hsarback/database/data.sql index bf699bb..7096a82 100644 --- a/hsarback/database/data.sql +++ b/hsarback/database/data.sql @@ -1,10 +1,12 @@ -- -- Table: basepacket -- -INSERT INTO basepacket (basepacket_code, description, sorting, valid) - VALUES ('DW/B', 'Dynamic-Web/Base', 100, true); -INSERT INTO basepacket (basepacket_code, description, sorting, valid) - VALUES ('SW/B', 'Static-Web/Base', 200, true); +INSERT INTO basepacket (basepacket_code, description, sorting, valid, article_number) + VALUES ('DW/B', 'Dynamic-Web/Base', 200, true, 100); +INSERT INTO basepacket (basepacket_code, description, sorting, valid, article_number) + VALUES ('SW/B', 'Static-Web/Base', 300, true, 200); +INSERT INTO basepacket (basepacket_code, description, sorting, valid, article_number) + VALUES ('WEB', 'Web/Base', 100, true, 300); -- -- Table: basecomponent @@ -59,8 +61,8 @@ INSERT INTO contact (bp_id, salut, first_name, last_name, firma, email) -- -- table: bank_account -- -INSERT INTO bank_account (bp_id) - SELECT bp_id FROM business_partner WHERE member_id=10000; +INSERT INTO bank_account (bp_id, autodebit_ga, autodebit_ar, autodebit_op) + SELECT bp_id, false, false, true FROM business_partner WHERE member_id=10000; -- -- table: billdata diff --git a/hsarback/database/schema.sql b/hsarback/database/schema.sql index a7d14b6..1571a5f 100644 --- a/hsarback/database/schema.sql +++ b/hsarback/database/schema.sql @@ -123,7 +123,8 @@ CREATE TABLE business_partner ( uid_vat character varying(20), CONSTRAINT ckc_member_id_business CHECK (((member_id >= 10000) AND (member_id <= 99999))), CONSTRAINT ckc_shares_signed_business CHECK ((shares_signed >= 0)), - CONSTRAINT ckt_business_partner CHECK ( ( ((member_since IS NULL) AND (member_until IS NULL)) OR ((member_since IS NOT NULL) AND (member_until IS NULL)) OR ((member_since IS NOT NULL) AND (member_until IS NOT NULL) AND (member_since < member_until)) ) AND ((member_code)::text ~~ 'hsh00-%'::text)) + CONSTRAINT ckt_business_partner CHECK ( ( ((member_since IS NULL) AND (member_until IS NULL)) OR ((member_since IS NOT NULL) AND (member_until IS NULL)) OR ((member_since IS NOT NULL) AND (member_until IS NOT NULL) AND (member_since < member_until)) ) AND ((member_code)::text ~~ 'hsh00-%'::text)), + UNIQUE (bp_id) );