summary refs log tree commit diff
path: root/synapse/storage/schema
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-10 15:59:35 +0100
committerGitHub <noreply@github.com>2019-10-10 15:59:35 +0100
commit329eae9cda8c57b00ce5aeba5ac12356a8ae9775 (patch)
tree810580232ad1fbb8943dbb37870978d44b62ddbe /synapse/storage/schema
parentMerge pull request #6191 from matrix-org/rav/fix_packaging (diff)
parentFix postgres unit tests (diff)
downloadsynapse-329eae9cda8c57b00ce5aeba5ac12356a8ae9775.tar.xz
Merge pull request #6186 from matrix-org/erikj/disable_sql_bytes
Disable bytes usage with postgres
Diffstat (limited to 'synapse/storage/schema')
-rw-r--r--synapse/storage/schema/delta/56/redaction_censor3_fix_update.sql.postgres17
1 files changed, 8 insertions, 9 deletions
diff --git a/synapse/storage/schema/delta/56/redaction_censor3_fix_update.sql.postgres b/synapse/storage/schema/delta/56/redaction_censor3_fix_update.sql.postgres
index f7bcc5e2f2..67471f3ef5 100644
--- a/synapse/storage/schema/delta/56/redaction_censor3_fix_update.sql.postgres
+++ b/synapse/storage/schema/delta/56/redaction_censor3_fix_update.sql.postgres
@@ -15,12 +15,11 @@
 
 
 -- There was a bug where we may have updated censored redactions as bytes,
--- which can (somehow) cause json to be inserted hex encoded. This goes and
--- undoes any such hex encoded JSON.
-UPDATE event_json SET json = convert_from(json::bytea, 'utf8')
-WHERE event_id IN (
-  SELECT event_json.event_id
-  FROM event_json
-  INNER JOIN redactions ON (event_json.event_id = redacts)
-  WHERE have_censored AND json NOT LIKE '{%'
-);
+-- which can (somehow) cause json to be inserted hex encoded. These updates go
+-- and undoes any such hex encoded JSON.
+
+INSERT into background_updates (update_name, progress_json)
+  VALUES ('event_fix_redactions_bytes_create_index', '{}');
+
+INSERT into background_updates (update_name, progress_json, depends_on)
+  VALUES ('event_fix_redactions_bytes', '{}', 'event_fix_redactions_bytes_create_index');