Skip to content

Commit 8d0c632

Browse files
committed
#259 Sql script updates for 4.4.0 release
1 parent 2473ec6 commit 8d0c632

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

release/4.4.0-release.sql

+23-22
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,15 @@ update alerts.query set email_template='/email/annotations' where name='Annotati
55

66
-- 2. My Annotations now uses its own template. To update the template, run the following query:
77
update alerts.query set email_template='/email/myAnnotations' where name='My Annotations';
8+
--- check
9+
810

911
-- 3. Annotation on records for Dataset / collections / species now uses its "Annotation" template. To update the template, run the following query:
1012

1113
UPDATE alerts.query
1214
SET email_template = '/email/annotations'
1315
WHERE name LIKE 'New annotations on%';
1416

15-
-- 4. Species List Annotations now share the same template with datasets. To update the template, run the following query:
16-
-- 4.1 Update fire_when_change to false for species list queries
17-
18-
UPDATE alerts.property_path
19-
SET fire_when_change = false
20-
WHERE query_id IN (
21-
SELECT query_id
22-
FROM query
23-
WHERE email_template = '/email/specieslists'
24-
);
25-
26-
-- -- 4.2
27-
-- update alerts.query set email_template="/email/datasets" where email_template='/email/specieslists';
2817

2918
--- disable fire_when_change for spatial layer
3019
UPDATE alerts.property_path
@@ -62,11 +51,11 @@ WHERE
6251

6352
-- Update some queries using api.test.ala.org.au and api.ala.org.au
6453

65-
UPDATE alerts.query
66-
SET
67-
base_url = 'https://biocache-ws-test.ala.org.au/ws'
68-
WHERE
69-
base_url LIKE 'https://api.test.ala.org.au/occurrences%';
54+
-- UPDATE alerts.query
55+
-- SET
56+
-- base_url = 'https://biocache-ws-test.ala.org.au/ws'
57+
-- WHERE
58+
-- base_url LIKE 'https://api.test.ala.org.au/occurrences%';
7059

7160

7261
UPDATE alerts.query
@@ -96,12 +85,22 @@ UPDATE `alerts`.`query`
9685
`base_url_forui` = 'https://lists.ala.org.au'
9786
WHERE (`id` = 'Replace it');
9887

88+
-- 4. Species List Annotations now share the same template with datasets. To update the template, run the following query:
89+
-- 4.1 Update fire_when_change to false for species list queries
90+
91+
--- NOT WORKING
92+
--- ************************
93+
UPDATE alerts.property_path
94+
SET fire_when_change = false,
95+
json_path = '$.lists'
96+
WHERE query_id = [species list query id: 556];
97+
9998

10099
--- Update query of datasets to match query of datasetResource
101100

102101
--- If datasetResource query already exists, then update the query id of the subscribers to datasetResource query id
103102
--- Find the query id which needs to migrate subscribers to datasetResource. e.g. query id: 7
104-
select * from notification where query_id = [id];
103+
select * from notification where query_id = [id:7];
105104
--- find subscribers details
106105
select * from user where id in (SELECT user_id FROM alerts.notification where query_id=[id]);
107106

@@ -115,6 +114,8 @@ SET `base_url` = 'https://biocache-ws.ala.org.au/ws',
115114
`id_json_path` = 'i18nCode',
116115
`query_path` = '/occurrences/search?q=*:*&facet=true&flimit=-1&facets=dataResourceUid&pageSize=0',
117116
`record_json_path` = '$.facetResults[0].fieldResult[*]',
118-
`email_template` = '/email/specieslist',
119-
`base_url_forui` = 'https://collections-test.ala.org.au'
120-
WHERE (`id` = 'Replace it');
117+
`email_template` = '/email/dataresource',
118+
`base_url_forui` = 'https://collections.ala.org.au'
119+
WHERE (`id` = 'Replace it:7');
120+
121+
update property_path set json_path='$.facetResults[0].fieldResult', fire_when_change=false where id=[property_path id:12];

0 commit comments

Comments
 (0)