summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-03-09 21:02:53 +0100
committerChristian Grothoff <christian@grothoff.org>2024-03-09 21:02:53 +0100
commitd0288577b076788ccbaae5821b2ddbe1ee6e4bd9 (patch)
tree33974b8b65176a035b5c453bfaff2c83b1cb4596
parentc8d5523bff1fd8c02d6fc2ff431302425342b7cf (diff)
downloadanastasis-d0288577b076788ccbaae5821b2ddbe1ee6e4bd9.tar.gz
anastasis-d0288577b076788ccbaae5821b2ddbe1ee6e4bd9.tar.bz2
anastasis-d0288577b076788ccbaae5821b2ddbe1ee6e4bd9.zip
improve drop.sql to avoid having to update it whenever new SQL revisions are added
-rw-r--r--src/stasis/drop.sql10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/stasis/drop.sql b/src/stasis/drop.sql
index 67aa4a1..357fa9d 100644
--- a/src/stasis/drop.sql
+++ b/src/stasis/drop.sql
@@ -17,8 +17,14 @@
-- Everything in one big transaction
BEGIN;
--- Unregister patch (0001.sql)
-SELECT _v.unregister_patch('stasis-0001');
+WITH xpatches AS (
+ SELECT patch_name
+ FROM _v.patches
+ WHERE starts_with(patch_name,'stasis-')
+)
+ SELECT _v.unregister_patch(xpatches.patch_name)
+ FROM xpatches;
+
DROP SCHEMA anastasis CASCADE;
-- And we're out of here...