Skip to content

Commit

Permalink
#259 sql script updates for 4.4.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
qifeng-bai committed Jan 15, 2025
1 parent 7cf834d commit 2473ec6
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions release/4.4.0-release.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ WHERE query_id IN (
WHERE email_template = '/email/specieslists'
);

-- 4.2
update alerts.query set email_template="/email/datasets" where email_template='/email/specieslists';
-- -- 4.2
-- update alerts.query set email_template="/email/datasets" where email_template='/email/specieslists';

--- disable fire_when_change for spatial layer
UPDATE alerts.property_path
Expand Down Expand Up @@ -94,4 +94,27 @@ UPDATE `alerts`.`query`
`record_json_path` = '$.lists[*]',
`email_template` = '/email/specieslist',
`base_url_forui` = 'https://lists.ala.org.au'
WHERE (`id` = 'Replace it');
WHERE (`id` = 'Replace it');


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

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

update query_id=[dataresourse id] where query_id=[id];
--- check if there are duplicate subscribers
--- delete datasets query by clicking on delete button in the query admin page

--- If datasetResource query does not exist, then create a new query with the following details
UPDATE `alerts`.`query`
SET `base_url` = 'https://biocache-ws.ala.org.au/ws',
`id_json_path` = 'i18nCode',
`query_path` = '/occurrences/search?q=*:*&facet=true&flimit=-1&facets=dataResourceUid&pageSize=0',
`record_json_path` = '$.facetResults[0].fieldResult[*]',
`email_template` = '/email/specieslist',
`base_url_forui` = 'https://collections-test.ala.org.au'
WHERE (`id` = 'Replace it');

0 comments on commit 2473ec6

Please sign in to comment.