Mercurial > gemma
annotate schema/updates/1313/01.optimize_area_policies.sql @ 5082:c4ebb6ccc588 time-sliding
client: start a request for the last changed time on time slider
* initiate a refresh layers request when the time for the
finished request differs from the selected time on time slider
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Wed, 18 Mar 2020 14:11:44 +0100 |
parents | 1fef9d8e7eb2 |
children |
rev | line source |
---|---|
4785
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
1 -- This is Free Software under GNU Affero General Public License v >= 3.0 |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
2 -- without warranty, see README.md and license for details. |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
3 |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
4 -- SPDX-License-Identifier: AGPL-3.0-or-later |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
5 -- License-Filename: LICENSES/AGPL-3.0.txt |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
6 |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
7 -- Copyright (C) 2019 by via donau |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
8 -- – Österreichische Wasserstraßen-Gesellschaft mbH |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
9 -- Software engineering by Intevation GmbH |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
10 |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
11 -- Author(s): |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
12 -- * Sascha Wilde <sascha.wilde@intevation.de> |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
13 -- * Tom Gottried <tom@intevation.de> |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
14 |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
15 |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
16 ALTER POLICY same_country ON waterway.gauge_measurements |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
17 TO waterway_admin |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
18 USING (staging_done |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
19 OR (location).country_code = |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
20 (SELECT country FROM users.list_users |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
21 WHERE username = current_user)) |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
22 WITH CHECK ((location).country_code = |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
23 (SELECT country FROM users.list_users |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
24 WHERE username = current_user)); |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
25 |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
26 ALTER POLICY same_country ON waterway.waterway_profiles |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
27 TO waterway_admin |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
28 USING (staging_done |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
29 OR (location).country_code = |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
30 (SELECT country FROM users.list_users |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
31 WHERE username = current_user)) |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
32 WITH CHECK ((location).country_code = |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
33 (SELECT country FROM users.list_users |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
34 WHERE username = current_user)); |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
35 |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
36 ALTER POLICY responsibility_area ON waterway.bottlenecks |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
37 TO waterway_admin |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
38 USING (staging_done OR users.utm_covers(area)) |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
39 WITH CHECK (users.utm_covers(area)); |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
40 |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
41 ALTER POLICY responsibility_area ON waterway.sounding_results |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
42 TO waterway_admin |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
43 USING (staging_done OR users.utm_covers(area)) |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
44 WITH CHECK (users.utm_covers(area)); |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
45 |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
46 ALTER POLICY responsibility_area ON waterway.fairway_dimensions |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
47 TO waterway_admin |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
48 USING (staging_done OR users.utm_covers(area)) |
1fef9d8e7eb2
Improved performance for RLS on read access.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
49 WITH CHECK (users.utm_covers(area)); |