RED-8561: updated sql query to update existing dossier dictionaries with dossier_dictionary_only=true
This commit is contained in:
parent
6bb3c93b84
commit
a98cc0a6f2
@ -1,7 +1,3 @@
|
|||||||
-- SELECT * FROM entity WHERE id NOT LIKE ALL (SELECT e.id || '%' FROM entity e WHERE e.dossier_id IS NULL) AND dossier_id IS NOT NULL;
|
|
||||||
--
|
|
||||||
-- INSERT INTO entity
|
|
||||||
|
|
||||||
INSERT INTO entity (id, add_to_dictionary_action, description, dossier_id, dossier_template_id, hex_color, is_case_insensitive, is_hint, is_recommendation,
|
INSERT INTO entity (id, add_to_dictionary_action, description, dossier_id, dossier_template_id, hex_color, is_case_insensitive, is_hint, is_recommendation,
|
||||||
label, rank, type, version, recommendation_hex_color, has_dictionary, system_managed, auto_hide_skipped, soft_deleted_time, skipped_hex_color,
|
label, rank, type, version, recommendation_hex_color, has_dictionary, system_managed, auto_hide_skipped, soft_deleted_time, skipped_hex_color,
|
||||||
dossier_dictionary_only)
|
dossier_dictionary_only)
|
||||||
@ -10,3 +6,7 @@ SELECT (SELECT trim(trailing ':' from trim(trailing e.dossier_id from e.id))), e
|
|||||||
TRUE
|
TRUE
|
||||||
FROM entity e
|
FROM entity e
|
||||||
WHERE (SELECT trim(trailing ':' from trim(trailing e.dossier_id from e.id))) IS NOT NULL AND (SELECT substr(e.id, POSITION(':' IN e.id) + POSITION(':' IN substr(e.id, POSITION(':' IN e.id) + 1)) + 1)) = '' IS FALSE;
|
WHERE (SELECT trim(trailing ':' from trim(trailing e.dossier_id from e.id))) IS NOT NULL AND (SELECT substr(e.id, POSITION(':' IN e.id) + POSITION(':' IN substr(e.id, POSITION(':' IN e.id) + 1)) + 1)) = '' IS FALSE;
|
||||||
|
|
||||||
|
UPDATE entity
|
||||||
|
SET dossier_dictionary_only = TRUE
|
||||||
|
WHERE starts_with(id, (SELECT trim(trailing ':' from trim(trailing dossier_id from id))));
|
||||||
Loading…
x
Reference in New Issue
Block a user