Skip to content

Commit 2473ec6

Browse files
committed
#259 sql script updates for 4.4.0 release
1 parent 7cf834d commit 2473ec6

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

release/4.4.0-release.sql

+26-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ WHERE query_id IN (
2323
WHERE email_template = '/email/specieslists'
2424
);
2525

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';
2828

2929
--- disable fire_when_change for spatial layer
3030
UPDATE alerts.property_path
@@ -94,4 +94,27 @@ UPDATE `alerts`.`query`
9494
`record_json_path` = '$.lists[*]',
9595
`email_template` = '/email/specieslist',
9696
`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

Comments
 (0)