HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2011-05-19 c464f55e9a53e10fe2d0cc25238b9d7ef1f94ab1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
--
-- 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);
    
--
-- Table: basecomponent
--
INSERT INTO basecomponent (basecomponent_code, description, sorting, valid)
    VALUES ('TRAFFIC', 'Monatliches Datenvolumen in GB', 100, true);
INSERT INTO basecomponent (basecomponent_code, description, sorting, valid)
    VALUES ('QUOTA', 'Festplattenspeicherplatz in MB', 200, true);
INSERT INTO basecomponent (basecomponent_code, description, sorting, valid)
    VALUES ('TOMCAT', 'Nutzung eines eigenen Tomcat-Servers', 300, true);
INSERT INTO basecomponent (basecomponent_code, description, sorting, valid)
    VALUES ('ZOPE', 'Nutzung eines eigenen Zope-Servers', 310, true);
INSERT INTO basecomponent (basecomponent_code, description, sorting, valid)
    VALUES ('APACHE', 'Nutzung eines eigenen Apache-Servers', 310, true);
 
--
-- Table: component
--
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only)
    SELECT basepacket_id, basecomponent_id, 128, 40960, 128, 128, 128, false FROM basepacket, basecomponent WHERE basepacket_code='DW/B' AND  basecomponent_code='QUOTA';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only)
    SELECT basepacket_id, basecomponent_id, 512, 40960, 512, 512, 512, false FROM basepacket, basecomponent WHERE basepacket_code='SW/B' AND  basecomponent_code='QUOTA';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only)
    SELECT basepacket_id, basecomponent_id, 2, 40960, 2, 2, 2, false FROM basepacket, basecomponent WHERE basepacket_code='DW/B' AND  basecomponent_code='TRAFFIC';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only)
    SELECT basepacket_id, basecomponent_id, 4, 40960, 4, 4, 4, false FROM basepacket, basecomponent WHERE basepacket_code='SW/B' AND  basecomponent_code='TRAFFIC';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only)
    SELECT basepacket_id, basecomponent_id, 0, 4, 0, 1, 0, false FROM basepacket, basecomponent WHERE basepacket_code='DW/B' AND  basecomponent_code='TOMCAT';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only)
    SELECT basepacket_id, basecomponent_id, 0, 0, 0, 1, 0, false FROM basepacket, basecomponent WHERE basepacket_code='SW/B' AND  basecomponent_code='TOMCAT';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only)
    SELECT basepacket_id, basecomponent_id, 0, 4, 0, 1, 0, false FROM basepacket, basecomponent WHERE basepacket_code='DW/B' AND  basecomponent_code='ZOPE';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only)
    SELECT basepacket_id, basecomponent_id, 0, 0, 0, 1, 0, false FROM basepacket, basecomponent WHERE basepacket_code='SW/B' AND  basecomponent_code='ZOPE';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only)
    SELECT basepacket_id, basecomponent_id, 0, 4, 0, 1, 0, false FROM basepacket, basecomponent WHERE basepacket_code='DW/B' AND  basecomponent_code='APACHE';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only)
    SELECT basepacket_id, basecomponent_id, 0, 0, 0, 1, 0, false FROM basepacket, basecomponent WHERE basepacket_code='SW/B' AND  basecomponent_code='APACHE';
 
--
-- Table: business_partner 
--
INSERT INTO business_partner (member_id, member_code, member_since, shares_signed)
    VALUES (10000, 'hsh00-hsh', current_date, 0);
 
--
-- table: contact 
--
INSERT INTO contact (bp_id, salut, first_name, last_name, firma, email)
    SELECT bp_id, 'Herr', 'Uwe', 'Mueller', 'Hostsharing eG', 'service@hostsharing.net' FROM business_partner WHERE member_id=10000;
 
--
-- table: bank_account 
--
INSERT INTO bank_account (bp_id)
    SELECT bp_id FROM business_partner WHERE member_id=10000;
 
--
-- table: billdata 
--
INSERT INTO billdata (bp_id)
    SELECT bp_id FROM business_partner WHERE member_id=10000;
 
--
-- Table: inet_addr 
--
INSERT INTO inet_addr (inet_addr, description)
    VALUES (inet '192.168.108.200', 'address 200');
INSERT INTO inet_addr (inet_addr, description)
    VALUES (inet '192.168.108.201', 'address 201');
INSERT INTO inet_addr (inet_addr, description)
    VALUES (inet '192.168.108.202', 'address 202');
INSERT INTO inet_addr (inet_addr, description)
    VALUES (inet '192.168.108.203', 'address 203');
INSERT INTO inet_addr (inet_addr, description)
    VALUES (inet '192.168.108.204', 'address 204');
INSERT INTO inet_addr (inet_addr, description)
    VALUES (inet '192.168.108.205', 'address 205');
INSERT INTO inet_addr (inet_addr, description)
    VALUES (inet '192.168.108.206', 'address 206');
INSERT INTO inet_addr (inet_addr, description)
    VALUES (inet '192.168.108.207', 'address 207');
INSERT INTO inet_addr (inet_addr, description)
    VALUES (inet '192.168.108.208', 'address 208');
INSERT INTO inet_addr (inet_addr, description)
    VALUES (inet '192.168.108.209', 'address 209');
INSERT INTO inet_addr (inet_addr, description)
    VALUES (inet '192.168.108.210', 'address 210');
 
--
-- Table: Hive 
--
INSERT INTO hive (hive_name, inet_addr_id, description)
    SELECT 'h81', inet_addr_id, 'Test Hive h081' FROM inet_addr WHERE inet_addr = inet '192.168.108.200';
 
--
-- table: packet 
--
INSERT INTO packet (packet_name, bp_id, hive_id, created, cur_inet_addr_id)
    SELECT 'hsh00', business_partner.bp_id, hive.hive_id, current_date, inet_addr.inet_addr_id FROM business_partner, hive, inet_addr 
        WHERE hive_name='h81' AND inet_addr = inet '192.168.108.201' AND member_id = 10000; 
INSERT INTO packet (packet_name, bp_id, hive_id, created, cur_inet_addr_id)
    SELECT 'hsh01', business_partner.bp_id, hive.hive_id, current_date, inet_addr.inet_addr_id FROM business_partner, hive, inet_addr 
        WHERE hive_name='h81' AND inet_addr = inet '192.168.108.202' AND member_id = 10000;
        
--
-- table: packet_component 
--
INSERT INTO packet_component (basepacket_id, basecomponent_id, packet_id, quantity, created)
    SELECT 1, 1, packet.packet_id, 2, current_date FROM packet 
        WHERE packet.packet_name = 'hsh00'; 
INSERT INTO packet_component (basepacket_id, basecomponent_id, packet_id, quantity, created)
    SELECT 1, 2, packet.packet_id, 128, current_date FROM packet 
        WHERE packet.packet_name = 'hsh00'; 
INSERT INTO packet_component (basepacket_id, basecomponent_id, packet_id, quantity, created)
    SELECT 1, 3, packet.packet_id, 0, current_date FROM packet 
        WHERE packet.packet_name = 'hsh00'; 
INSERT INTO packet_component (basepacket_id, basecomponent_id, packet_id, quantity, created)
    SELECT 1, 4, packet.packet_id, 0, current_date FROM packet 
        WHERE packet.packet_name = 'hsh00'; 
INSERT INTO packet_component (basepacket_id, basecomponent_id, packet_id, quantity, created)
    SELECT 1, 5, packet.packet_id, 0, current_date FROM packet 
        WHERE packet.packet_name = 'hsh00'; 
INSERT INTO packet_component (basepacket_id, basecomponent_id, packet_id, quantity, created)
    SELECT 1, 1, packet.packet_id, 2, current_date FROM packet 
        WHERE packet.packet_name = 'hsh01'; 
INSERT INTO packet_component (basepacket_id, basecomponent_id, packet_id, quantity, created)
    SELECT 1, 2, packet.packet_id, 128, current_date FROM packet 
        WHERE packet.packet_name = 'hsh01'; 
INSERT INTO packet_component (basepacket_id, basecomponent_id, packet_id, quantity, created)
    SELECT 1, 3, packet.packet_id, 0, current_date FROM packet 
        WHERE packet.packet_name = 'hsh01'; 
INSERT INTO packet_component (basepacket_id, basecomponent_id, packet_id, quantity, created)
    SELECT 1, 4, packet.packet_id, 0, current_date FROM packet 
        WHERE packet.packet_name = 'hsh01'; 
INSERT INTO packet_component (basepacket_id, basecomponent_id, packet_id, quantity, created)
    SELECT 1, 5, packet.packet_id, 0, current_date FROM packet 
        WHERE packet.packet_name = 'hsh01'; 
 
--
-- table: unixuser 
--
INSERT INTO unixuser (name, comment, shell, homedir, locked, packet_id, userid)
    SELECT 'hsh00', 'packet hsh00', '/bin/bash', '/home/pacs/hsh00', FALSE, packet_id, 10001 FROM packet 
        WHERE packet_name='hsh00'; 
INSERT INTO unixuser (name, comment, shell, homedir, locked, packet_id, userid)
    SELECT 'hsh01', 'packet hsh01', '/bin/bash', '/home/pacs/hsh01', FALSE, packet_id, 10002 FROM packet 
        WHERE packet_name='hsh01'; 
INSERT INTO unixuser (name, comment, shell, homedir, locked, packet_id, userid)
    SELECT 'hsh01-ad', 'hostmaster ad', '/bin/bash', '/home/pacs/hsh01/users/ad', FALSE, packet_id, 10003 FROM packet 
        WHERE packet_name='hsh01';