Mercurial > lada > lada-server
annotate src/test/resources/datasets/clean_and_seed.sql @ 1161:ea6b062e5305 pgaudit
Use pgaudit to generate an audit trail.
Upgrade to PostgreSQL 9.5 because it is a requirement for pgaudit.
pgaudit/analyze can be used to transfer the audit trail into the
database, but it seems to be easy to do this with pgaudit directly
with some changes to the code.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Tue, 08 Nov 2016 19:21:24 +0100 |
parents | 186d602e031a |
children | 93918aca306e |
rev | line source |
---|---|
977
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
1 SET search_path TO stammdaten; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
2 |
980 | 3 -- cleanup |
977
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
4 DELETE FROM auth; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
5 DELETE FROM ort; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
6 DELETE FROM ort_typ; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
7 DELETE FROM pflicht_messgroesse; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
8 DELETE FROM datenbasis; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
9 DELETE FROM mess_einheit; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
10 DELETE FROM messgroesse; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
11 DELETE FROM mess_methode; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
12 DELETE FROM datensatz_erzeuger; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
13 DELETE FROM mess_stelle; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
14 DELETE FROM probenehmer; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
15 DELETE FROM messprogramm_kategorie; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
16 DELETE FROM netz_betreiber; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
17 DELETE FROM probenart; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
18 DELETE FROM proben_zusatz; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
19 DELETE FROM koordinaten_art; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
20 DELETE FROM staat; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
21 DELETE FROM umwelt; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
22 DELETE FROM verwaltungseinheit; |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
23 |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
24 -- seed |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
25 -- minimal master data to make interface tests runnable |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
26 INSERT INTO ort_typ (id) VALUES (1); |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
27 INSERT INTO datenbasis (id) VALUES (9); |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
28 INSERT INTO mess_einheit (id) VALUES (207); |
1097
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
980
diff
changeset
|
29 INSERT INTO mess_einheit (id) VALUES (208); |
977
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
30 INSERT INTO messgroesse (id, messgroesse) VALUES (56, 'Mangan'); |
1097
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
980
diff
changeset
|
31 INSERT INTO messgroesse (id, messgroesse) VALUES (57, 'Mangan'); |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
980
diff
changeset
|
32 INSERT INTO mess_methode (id) VALUES ('A3'); |
977
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
33 INSERT INTO netz_betreiber (id) VALUES ('06'); |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
34 INSERT INTO mess_stelle (id, netzbetreiber_id) VALUES ('06010', '06'); |
1097
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
980
diff
changeset
|
35 INSERT INTO pflicht_messgroesse (id, mmt_id, datenbasis_id) VALUES (33, 'A3', 9); |
977
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
36 INSERT INTO probenart (id, probenart, probenart_eudf_id) VALUES (1, 'E', 'A'); |
1097
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
980
diff
changeset
|
37 INSERT INTO probenart (id, probenart, probenart_eudf_id) VALUES (2, 'S', 'B'); |
977
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
38 INSERT INTO proben_zusatz (id, beschreibung, zusatzwert) |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
39 VALUES ('A74', 'Volumenstrom', 'VOLSTR'); |
1097
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
980
diff
changeset
|
40 INSERT INTO proben_zusatz (id, beschreibung, zusatzwert) |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
980
diff
changeset
|
41 VALUES ('A75', 'Volumenstrom', 'VOLSTR'); |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
980
diff
changeset
|
42 INSERT INTO proben_zusatz (id, beschreibung, zusatzwert) |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
980
diff
changeset
|
43 VALUES ('A76', 'Volumenstrom', 'VOLSTR'); |
977
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
44 INSERT INTO koordinaten_art (id) VALUES (5); |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
45 INSERT INTO staat (id, staat, hkl_id, staat_iso) |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
46 VALUES (0, 'Deutschland', 0, 'DE'); |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
47 INSERT INTO umwelt (id, umwelt_bereich) VALUES ('L6', 'Spurenmessung Luft'); |
1097
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
980
diff
changeset
|
48 INSERT INTO umwelt (id, umwelt_bereich) VALUES ('A6', 'Umweltbereich für test'); |
977
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
49 INSERT INTO verwaltungseinheit ( |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
50 id, bundesland, bezeichnung, |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
51 is_bundesland, is_gemeinde, is_landkreis, is_regbezirk) |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
52 VALUES ('11000000', '11000000', 'Berlin', 1, 1, 1, 0); |
1097
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
980
diff
changeset
|
53 INSERT INTO probenehmer ( |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
980
diff
changeset
|
54 id, netzbetreiber_id, prn_id, bezeichnung, kurz_bezeichnung) |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
980
diff
changeset
|
55 VALUES (726, '06', 'prn', 'test', 'test'); |
977
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
56 |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
57 -- authorization data needed for tests |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
58 INSERT INTO auth (ldap_group, netzbetreiber_id, mst_id, funktion_id) |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
59 VALUES ('mst_06_status', '06', '06010', 1); |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
60 INSERT INTO auth (ldap_group, netzbetreiber_id, funktion_id) |
aba3a5384c69
Use a minimal set of master data based on empty database for tests.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
61 VALUES ('land_06_stamm', '06', 4); |