Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix support for SQLite 3.7. #6499

Merged
merged 5 commits into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions synapse/storage/data_stores/main/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,13 @@ def _censor_redactions(self):
if self.hs.config.redaction_retention_period is None:
return

if self.db.updates.has_completed_background_update(
erikjohnston marked this conversation as resolved.
Show resolved Hide resolved
"redactions_have_censored_ts_idx"
):
# We don't want to run this until the appropriate index has been
# created.
return

before_ts = self._clock.time_msec() - self.hs.config.redaction_retention_period

# We fetch all redactions that:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ ALTER TABLE redactions ADD COLUMN received_ts BIGINT;
INSERT INTO background_updates (update_name, progress_json) VALUES
('redactions_received_ts', '{}');

INSERT INTO background_updates (update_name, progress_json) VALUES
('redactions_have_censored_ts_idx', '{}');
INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES
('redactions_have_censored_ts_idx', '{}', 'redactions_have_censored_idx');