aboutsummaryrefslogtreecommitdiff
path: root/flakes/etherpad-lite/etherpad_cleanup.sql
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 01:35:06 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 02:11:48 +0200
commit1a64deeb894dc95e2645a75771732c6cc53a79ad (patch)
tree1b9df4838f894577a09b9b260151756272efeb53 /flakes/etherpad-lite/etherpad_cleanup.sql
parentfa25ffd4583cc362075cd5e1b4130f33306103f0 (diff)
downloadNix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz
Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst
Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them contained personnal information about users. All thos changes got stashed into a single commit (history is kept in a different place) and private information was moved in a separate private repository
Diffstat (limited to 'flakes/etherpad-lite/etherpad_cleanup.sql')
-rw-r--r--flakes/etherpad-lite/etherpad_cleanup.sql30
1 files changed, 30 insertions, 0 deletions
diff --git a/flakes/etherpad-lite/etherpad_cleanup.sql b/flakes/etherpad-lite/etherpad_cleanup.sql
new file mode 100644
index 0000000..4002715
--- /dev/null
+++ b/flakes/etherpad-lite/etherpad_cleanup.sql
@@ -0,0 +1,30 @@
1DO $$
2 DECLARE todelete record;
3 BEGIN
4 FOR todelete IN
5 select split_part(key, ':', 4) as k from store where key like 'mypads:jobqueue:deletePad:%'
6 LOOP
7 select * from store where key in (select 'readonly2pad:' || split_part(value, '"', 2) from store where key = 'pad2readonly:' || todelete.k);
8 select * from store where key = 'pad2readonly:' || todelete.k;
9 select * from store where key like 'pad:' || todelete.k || ':revs:%';
10 select * from store where key like 'pad:' || todelete.k || ':chats:%';
11 END LOOP;
12 END $$
13
14-- /nix/store/1i77431p6996lbyflpkb803zsiaj24kx-etherpad-lite-1.8.3/node_modules/ep_mypads/scripts/mypads-jobqueue-minion.js
15for toDelete in
16 select split_part(key, ':', 4) from store where key like 'mypads:jobqueue:deletePad:%'
17loop
18 select * from store where key in (select 'readonly2pad:' || split_part(value, '"', 2) from store where key = 'pad2readonly:' || toDelete);
19 select * from store where key = 'pad2readonly:' || toDelete;
20 select * from store where key like 'pad:' || toDelete || ':revs:%';
21 select * from store where key like 'pad:' || toDelete || ':chats:%';
22end loop
23--select * from store where key in (select 'pad2readonly:' || split_part(key, ':', 4) from store where key like 'mypads:jobqueue:deletePad:%');
24--
25--delete from store where key in (select 'readonly2pad:' || split_part(value, '"', 2) from store where key in (select 'pad2readonly:' || split_part(key, ':', 4) from store where key like 'mypads:jobqueue:deletePad:%'))
26--delete from store where key in (select 'pad2readonly:' || split_part(key, ':', 4) from store where key like 'mypads:jobqueue:deletePad:%');
27--delete from store where key like any(select 'pad:' || split_part(key, ':', 4) || ':revs:%' from store where key like 'mypads:jobqueue:deletePad:%');
28--delete from store where key like any(select 'pad:' || split_part(key, ':', 4) || ':chats:%' from store where key like 'mypads:jobqueue:deletePad:%');
29--delete from store where key like 'mypads:jobqueue:deletePad:%';
30