summary refs log tree commit diff
path: root/synapse/storage/schema
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-05-28 18:52:41 +0100
committerErik Johnston <erik@matrix.org>2019-05-29 15:11:26 +0100
commitd79c9994f416ee5dab27a277fa729ffa5ee74ccc (patch)
tree2dfe4f77fb9a542f8cf776bde747498d7ed30a59 /synapse/storage/schema
parentCorrectly filter out extremities with soft failed prevs (#5274) (diff)
downloadsynapse-d79c9994f416ee5dab27a277fa729ffa5ee74ccc.tar.xz
Add DB bg update to cleanup extremities.
Due to #5269 we may have extremities in our DB that we shouldn't have,
so lets add a cleanup task such to remove those.
Diffstat (limited to 'synapse/storage/schema')
-rw-r--r--synapse/storage/schema/delta/54/delete_forward_extremities.sql19
1 files changed, 19 insertions, 0 deletions
diff --git a/synapse/storage/schema/delta/54/delete_forward_extremities.sql b/synapse/storage/schema/delta/54/delete_forward_extremities.sql
new file mode 100644
index 0000000000..7056bd1d00
--- /dev/null
+++ b/synapse/storage/schema/delta/54/delete_forward_extremities.sql
@@ -0,0 +1,19 @@
+/* Copyright 2019 The Matrix.org Foundation C.I.C.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+INSERT INTO background_updates (update_name, progress_json) VALUES
+  ('delete_soft_failed_extremities', '{}');
+
+CREATE TABLE _extremities_to_check AS SELECT event_id FROM event_forward_extremities;