From 57678620fcbc035b68ed23288775f46e464762c4 Mon Sep 17 00:00:00 2001 From: Franck LECUYER Date: Wed, 26 Jun 2024 15:12:41 +0200 Subject: [PATCH] Remove RATIO_REGULATING, RATIO_REGULATION_MODE and PHASE_REGULATING fields in rules for existing expert filters. Signed-off-by: Franck LECUYER --- .../changesets/changelog_20240625T151341Z.xml | 11 ++++++++++ ...ionDataExpertRule_2wt_20240625T151341Z.sql | 20 +++++++++++++++++++ .../db/changelog/db.changelog-master.yaml | 5 ++++- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/db/changelog/changesets/changelog_20240625T151341Z.xml create mode 100644 src/main/resources/db/changelog/changesets/migrationDataExpertRule_2wt_20240625T151341Z.sql diff --git a/src/main/resources/db/changelog/changesets/changelog_20240625T151341Z.xml b/src/main/resources/db/changelog/changesets/changelog_20240625T151341Z.xml new file mode 100644 index 00000000..6d46b37b --- /dev/null +++ b/src/main/resources/db/changelog/changesets/changelog_20240625T151341Z.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/src/main/resources/db/changelog/changesets/migrationDataExpertRule_2wt_20240625T151341Z.sql b/src/main/resources/db/changelog/changesets/migrationDataExpertRule_2wt_20240625T151341Z.sql new file mode 100644 index 00000000..937195f7 --- /dev/null +++ b/src/main/resources/db/changelog/changesets/migrationDataExpertRule_2wt_20240625T151341Z.sql @@ -0,0 +1,20 @@ +-- Remove rules on no more used field RATIO_REGULATING for two windings transformers +DELETE FROM expert_rule_value t1 +WHERE EXISTS (SELECT * FROM expert_rule t2 WHERE t1.id = t2.id AND t2.field='RATIO_REGULATING'); + +DELETE FROM expert_rule t +WHERE t.field='RATIO_REGULATING'; + +-- Remove rules on no more used field PHASE_REGULATING for two windings transformers +DELETE FROM expert_rule_value t1 +WHERE EXISTS (SELECT * FROM expert_rule t2 WHERE t1.id = t2.id AND t2.field='PHASE_REGULATING'); + +DELETE FROM expert_rule t +WHERE t.field='PHASE_REGULATING'; + +-- Remove rules on field RATIO_REGULATION_MODE for two windings transformers (rule values list has changed) +DELETE FROM expert_rule_value t1 +WHERE EXISTS (SELECT * FROM expert_rule t2 WHERE t1.id = t2.id AND t2.field='RATIO_REGULATION_MODE'); + +DELETE FROM expert_rule t +WHERE t.field='RATIO_REGULATION_MODE'; diff --git a/src/main/resources/db/changelog/db.changelog-master.yaml b/src/main/resources/db/changelog/db.changelog-master.yaml index 726dc567..e721a478 100644 --- a/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/src/main/resources/db/changelog/db.changelog-master.yaml @@ -45,4 +45,7 @@ databaseChangeLog: relativeToChangelogFile: true - include: file: changesets/changelog_20240426T120841Z.xml - relativeToChangelogFile: true \ No newline at end of file + relativeToChangelogFile: true + - include: + file: changesets/changelog_20240625T151341Z.xml + relativeToChangelogFile: true