@@ -23,8 +23,8 @@ WHERE query_id IN (
23
23
WHERE email_template = ' /email/specieslists'
24
24
);
25
25
26
- -- 4.2
27
- update alerts .query set email_template= " /email/datasets" where email_template= ' /email/specieslists' ;
26
+ -- -- 4.2
27
+ -- update alerts.query set email_template="/email/datasets" where email_template='/email/specieslists';
28
28
29
29
-- - disable fire_when_change for spatial layer
30
30
UPDATE alerts .property_path
@@ -94,4 +94,27 @@ UPDATE `alerts`.`query`
94
94
` record_json_path` = ' $.lists[*]' ,
95
95
` email_template` = ' /email/specieslist' ,
96
96
` base_url_forui` = ' https://lists.ala.org.au'
97
- WHERE (` id` = ' Replace it' );
97
+ WHERE (` id` = ' Replace it' );
98
+
99
+
100
+ -- - Update query of datasets to match query of datasetResource
101
+
102
+ -- - If datasetResource query already exists, then update the query id of the subscribers to datasetResource query id
103
+ -- - Find the query id which needs to migrate subscribers to datasetResource. e.g. query id: 7
104
+ select * from notification where query_id = [id];
105
+ -- - find subscribers details
106
+ select * from user where id in (SELECT user_id FROM alerts .notification where query_id= [id]);
107
+
108
+ update query_id= [dataresourse id] where query_id= [id];
109
+ -- - check if there are duplicate subscribers
110
+ -- - delete datasets query by clicking on delete button in the query admin page
111
+
112
+ -- - If datasetResource query does not exist, then create a new query with the following details
113
+ UPDATE ` alerts` .` query`
114
+ SET ` base_url` = ' https://biocache-ws.ala.org.au/ws' ,
115
+ ` id_json_path` = ' i18nCode' ,
116
+ ` query_path` = ' /occurrences/search?q=*:*&facet=true&flimit=-1&facets=dataResourceUid&pageSize=0' ,
117
+ ` 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' );
0 commit comments