diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-03-09 21:02:31 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-03-09 21:02:31 +0100 |
commit | 904a15eec6884f049d70dfdb7043f8aed3bbebc0 (patch) | |
tree | 2022f2235beda02a1a239b96d355513595502de2 /src/exchangedb | |
parent | 0d6b079cfa1a8e2dca7f58979bb776bb5a72cb8e (diff) |
improve drop.sql to avoid having to update it whenever new SQL revisions are added
Diffstat (limited to 'src/exchangedb')
-rw-r--r-- | src/exchangedb/drop.sql | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/exchangedb/drop.sql b/src/exchangedb/drop.sql index fa7609bfd..b7583f794 100644 --- a/src/exchangedb/drop.sql +++ b/src/exchangedb/drop.sql @@ -17,14 +17,19 @@ -- Everything in one big transaction BEGIN; --- TODO: consider use exchange-* in the future! -SELECT _v.unregister_patch('exchange-0001'); -SELECT _v.unregister_patch('exchange-0002'); +WITH xpatches AS ( + SELECT patch_name + FROM _v.patches + WHERE starts_with(patch_name,'exchange-') +) + SELECT _v.unregister_patch(xpatches.patch_name) + FROM xpatches; + WITH xpatches AS ( SELECT patch_name FROM _v.patches - WHERE patch_name='auditor-triggers-0001' -- TODO: use auditor-triggers-* in the future! + WHERE starts_with(patch_name,'auditor-triggers-') ) SELECT _v.unregister_patch(xpatches.patch_name) FROM xpatches; |