Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Revoke public Space links and their push subscriptions

Anand Baburajanab3068eed9f1
diff --git a/server/migrations/142_revoke_space_links.down.sql b/server/migrations/142_revoke_space_links.down.sql
new file mode 100644
index 0000000000..9f7060a47f
--- /dev/null
+++ b/server/migrations/142_revoke_space_links.down.sql
@@ -0,0 +1 @@
+-- no-op
diff --git a/server/migrations/142_revoke_space_links.up.sql b/server/migrations/142_revoke_space_links.up.sql
new file mode 100644
index 0000000000..253ad60502
--- /dev/null
+++ b/server/migrations/142_revoke_space_links.up.sql
@@ -0,0 +1,14 @@
+BEGIN;
+
+UPDATE space_links
+SET active = FALSE
+WHERE active = TRUE;
+
+DELETE FROM space_web_push_subscriptions
+WHERE link_id IN (
+ SELECT link_id
+ FROM space_links
+ WHERE active = FALSE
+);
+
+COMMIT;