Created
July 25, 2022 13:17
-
-
Save anonfloppa/160b74040346e1d4ad88d5bf48ca26df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TEMP TABLE old_rooms AS | |
select distinct e_create.room_id | |
from events e_create | |
where e_create.type='m.room.create' and | |
e_create.origin_server_ts < [INSERT TIMESTAMP HERE]; # filter rooms created before timestamp, newer rooms not affected | |
CREATE TEMP TABLE old_rooms_new_events AS | |
select * | |
from events e_types | |
where exists(select * from old_rooms where old_rooms.room_id = e_types.room_id) and | |
e_types.origin_server_ts > [INSERT TIMESTAMP HERE]; # filter events after this timestamp to see if there are any. | |
select distinct room_id from events final_e where exists(select * from old_rooms where old_rooms.room_id=final_e.room_id) and not exists(select * from old_rooms_new_events where old_rooms_new_events.room_id=final_e.room_id); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment