comparison db_schema/setup-db.sh @ 1173:5239306ee55e pgaudit

Improbe audit trail configuration. Audit only relevant columns, thus not internal stuff like tree_modified. Audit INSERT also, because we will need it to track initial values.
author Tom Gottfried <tom@intevation.de>
date Fri, 11 Nov 2016 16:50:00 +0100
parents 74e5b9630064
children 2e59a51d914f
comparison
equal deleted inserted replaced
1170:74e5b9630064 1173:5239306ee55e
84 84
85 echo configure audit trail 85 echo configure audit trail
86 psql $DB_CONNECT_STRING -d $DB_NAME --command \ 86 psql $DB_CONNECT_STRING -d $DB_NAME --command \
87 "ALTER DATABASE $DB_NAME SET pgaudit.role TO '$AUDITOR_ROLE'; 87 "ALTER DATABASE $DB_NAME SET pgaudit.role TO '$AUDITOR_ROLE';
88 ALTER DATABASE $DB_NAME SET pgaudit.log_parameter TO on; 88 ALTER DATABASE $DB_NAME SET pgaudit.log_parameter TO on;
89 GRANT UPDATE, DELETE ON 89 GRANT DELETE ON
90 land.probe, 90 land.probe,
91 land.kommentar_p,
92 land.ortszuordnung, 91 land.ortszuordnung,
93 land.zusatz_wert, 92 land.zusatz_wert,
94 land.messung, 93 land.messung,
95 land.kommentar_m,
96 land.messwert, 94 land.messwert,
97 land.status_protokoll 95 land.status_protokoll
98 TO $AUDITOR_ROLE;" 96 TO $AUDITOR_ROLE;
97 GRANT INSERT, UPDATE, DELETE ON
98 land.kommentar_p,
99 land.kommentar_m
100 TO $AUDITOR_ROLE;
101 GRANT INSERT, UPDATE (
102 id_alt,
103 test,
104 mst_id,
105 labor_mst_id,
106 hauptproben_nr,
107 datenbasis_id,
108 ba_id,
109 probenart_id,
110 media_desk,
111 media,
112 umw_id,
113 probeentnahme_beginn,
114 probeentnahme_ende,
115 mittelungsdauer,
116 erzeuger_id,
117 probe_nehmer_id,
118 mpl_id,
119 mpr_id,
120 solldatum_beginn,
121 solldatum_ende
122 ) ON land.probe TO $AUDITOR_ROLE;
123 GRANT INSERT, UPDATE (
124 ort_id,
125 ortszuordnung_typ,
126 ortszusatztext
127 ) ON land.ortszuordnung TO $AUDITOR_ROLE;
128 GRANT INSERT, UPDATE (
129 pzs_id,
130 messwert_pzs,
131 messfehler,
132 nwg_zu_messwert
133 ) ON land.zusatz_wert TO $AUDITOR_ROLE;
134 GRANT INSERT, UPDATE (
135 id_alt,
136 nebenproben_nr,
137 mmt_id,
138 messdauer,
139 messzeitpunkt,
140 fertig,
141 geplant
142 ) ON land.messung TO $AUDITOR_ROLE;
143 GRANT INSERT, UPDATE (
144 messgroesse_id,
145 messwert_nwg,
146 messwert,
147 messfehler,
148 nwg_zu_messwert,
149 meh_id,
150 grenzwertueberschreitung
151 ) ON land.messwert TO $AUDITOR_ROLE;
152 GRANT INSERT, UPDATE (
153 mst_id,
154 datum,
155 text,
156 messungs_id,
157 status_kombi
158 ) ON land.status_protokoll TO $AUDITOR_ROLE;"
99 159
100 if [ "$NO_DATA" != "true" ]; then 160 if [ "$NO_DATA" != "true" ]; then
101 echo import stammdaten 161 echo import stammdaten
102 psql -q $DB_CONNECT_STRING -d $DB_NAME -f $DIR/stammdaten_data.sql 162 psql -q $DB_CONNECT_STRING -d $DB_NAME -f $DIR/stammdaten_data.sql
103 163
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)