update sql scripts

This commit is contained in:
Peter Hormanns 2017-04-10 18:42:48 +02:00
parent 3264be68a9
commit 69f3721e98
5 changed files with 648 additions and 255 deletions

View File

@ -73,13 +73,7 @@ INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quanti
SELECT basepacket_id, basecomponent_id, 1, 16, 1, 1, 0, false, 420 FROM basepacket, basecomponent WHERE basepacket_code='SRV/MGD' AND basecomponent_code='CPU'; SELECT basepacket_id, basecomponent_id, 1, 16, 1, 1, 0, false, 420 FROM basepacket, basecomponent WHERE basepacket_code='SRV/MGD' AND basecomponent_code='CPU';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number) INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
SELECT basepacket_id, basecomponent_id, 10, 1000, 10, 10, 0, false, 430 FROM basepacket, basecomponent WHERE basepacket_code='SRV/MGD' AND basecomponent_code='TRAFFIC'; SELECT basepacket_id, basecomponent_id, 10, 1000, 10, 10, 0, false, 430 FROM basepacket, basecomponent WHERE basepacket_code='SRV/MGD' AND basecomponent_code='TRAFFIC';
--
-- Table: role
--
INSERT INTO role (role_name) VALUES ('billing');
INSERT INTO role (role_name) VALUES ('operation');
-- --
-- Table: business_partner -- Table: business_partner
-- --
@ -90,16 +84,8 @@ INSERT INTO business_partner (member_id, member_code, member_since, shares_signe
-- table: contact -- table: contact
-- --
INSERT INTO contact (bp_id, salut, first_name, last_name, firma, email) INSERT INTO contact (bp_id, salut, first_name, last_name, firma, email)
SELECT bp_id, 'Herr', 'Sigi', 'Superb', 'Hosting Inc.', 'info@example.com' FROM business_partner WHERE member_id=10000; SELECT bp_id, 'Herr', 'Uwe', 'Mueller', 'Hostsharing eG', 'service@hostsharing.net' FROM business_partner WHERE member_id=10000;
--
-- table: contactrole_ref
--
INSERT INTO contactrole_ref ( contact_id, role )
SELECT contact_id, 'billing' FROM contact WHERE email='info@example.com';
INSERT INTO contactrole_ref ( contact_id, role )
SELECT contact_id, 'operation' FROM contact WHERE email='info@example.com';
-- --
-- Table: inet_addr -- Table: inet_addr
-- --
@ -213,10 +199,11 @@ INSERT INTO domain_option (domain_option_name)
-- --
-- table: price_list -- table: price_list
-- --
INSERT INTO price_list VALUES (1, 'Default Price List'); INSERT INTO price_list (name) VALUES ('Default Price List');
-- --
-- table: customer_price_list_mapping -- table: customer_price_list_mapping
-- --
INSERT INTO pricelist_ref (SELECT bp_id, 'Default Price List' FROM business_partner); INSERT INTO pricelist_ref (SELECT business_partner.bp_id, price_list.name FROM business_partner, price_list);

View File

@ -0,0 +1,43 @@
DROP TABLE pricelist_ref ;
DROP TABLE price ;
DROP TABLE price_list CASCADE ;
-- DROP VIEW business_partner_ticket ;
DROP TABLE sepa_mandat ;
DROP SEQUENCE sepa_mandat_id_seq ;
DROP SEQUENCE contact_contact_id_seq ;
DROP TABLE contact CASCADE ;
DROP TABLE database ;
DROP TABLE database_user ;
DROP SEQUENCE database_database_id_seq ;
DROP SEQUENCE dbuser_dbuser_id_seq ;
DROP TABLE emailaddr ;
DROP SEQUENCE emailaddr_emailaddr_id_seq ;
DROP TABLE emailalias ;
DROP SEQUENCE emailalias_emailalias_id_seq ;
DROP TABLE domain__domain_option ;
DROP TABLE domain_option ;
DROP SEQUENCE domain_option_id_seq ;
DROP TABLE domain ;
DROP SEQUENCE domain_domain_id_seq ;
DROP TABLE queue_task ;
DROP SEQUENCE queue_task_id_seq ;
DROP TABLE unixuser CASCADE ;
DROP SEQUENCE unixuser_unixuser_id_seq ;
DROP TABLE packet_component ;
DROP TABLE component ;
DROP TABLE basecomponent ;
DROP TABLE basepacket CASCADE ;
DROP SEQUENCE basecomponent_basecomponent_seq ;
DROP SEQUENCE basepacket_basepacket_id_seq ;
DROP TABLE packet ;
DROP SEQUENCE packet_packet_id_seq ;
DROP TABLE hive ;
DROP SEQUENCE hive_hive_id_seq ;
DROP TABLE inet_addr ;
DROP SEQUENCE inet_addr_inet_addr_id_seq ;
DROP TABLE business_partner CASCADE ;
DROP SEQUENCE business_partner_bp_id_seq ;
DROP SEQUENCE packet_component_id_seq ;
DROP SEQUENCE component_id_seq ;
DROP TABLE contactrole_ref CASCADE ;
DROP TABLE role CASCADE ;

View File

@ -0,0 +1,58 @@
INSERT INTO contactrole_ref (contact_id, role)
( SELECT contact_id, 'voting-right' FROM contact );
CREATE TABLE member_asset (
member_asset_id integer NOT NULL,
bp_id integer NOT NULL,
date date,
action character varying(60),
amount numeric,
comment character varying(160)
);
CREATE SEQUENCE member_asset_member_asset_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE member_asset_member_asset_id_seq OWNED BY member_asset.member_asset_id;
ALTER TABLE ONLY member_asset ALTER COLUMN member_asset_id SET DEFAULT nextval('member_asset_member_asset_id_seq'::regclass);
CREATE TABLE member_share (
member_share_id integer NOT NULL,
bp_id integer NOT NULL,
date date,
action character varying(60),
quantity integer,
comment character varying(160)
);
CREATE SEQUENCE member_share_member_share_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE member_share_member_share_id_seq OWNED BY member_share.member_share_id;
ALTER TABLE ONLY member_share ALTER COLUMN member_share_id SET DEFAULT nextval('member_share_member_share_id_seq'::regclass);
ALTER TABLE ONLY member_asset
ADD CONSTRAINT pk_member_asset PRIMARY KEY (member_asset_id);
ALTER TABLE ONLY member_share
ADD CONSTRAINT pk_member_share PRIMARY KEY (member_share_id);
ALTER TABLE ONLY member_asset
ADD CONSTRAINT pk_member_asset PRIMARY KEY (member_asset_id);
ALTER TABLE business_partner DROP CONSTRAINT ckc_shares_signed_business;
ALTER TABLE business_partner DROP COLUMN shares_updated ;
ALTER TABLE business_partner DROP COLUMN shares_signed ;

File diff suppressed because it is too large Load Diff