summary refs log tree commit diff
path: root/synapse/storage/schema
diff options
context:
space:
mode:
authorreivilibre <oliverw@matrix.org>2022-05-19 14:16:49 +0100
committerGitHub <noreply@github.com>2022-05-19 14:16:49 +0100
commit66a5f6c40018018cccffd79aded0850d13efe513 (patch)
tree9b645f47eb00ba8ff5e3ea27b4802e8673116560 /synapse/storage/schema
parenthash_password: raise an error if no config file is specified (#12789) (diff)
downloadsynapse-66a5f6c40018018cccffd79aded0850d13efe513.tar.xz
Add a unique index to `state_group_edges` to prevent duplicates being accidentally introduced and the consequential impact to performance. (#12687)
Diffstat (limited to 'synapse/storage/schema')
-rw-r--r--synapse/storage/schema/state/delta/70/08_state_group_edges_unique.sql17
1 files changed, 17 insertions, 0 deletions
diff --git a/synapse/storage/schema/state/delta/70/08_state_group_edges_unique.sql b/synapse/storage/schema/state/delta/70/08_state_group_edges_unique.sql
new file mode 100644
index 0000000000..b8c0ee0fa0
--- /dev/null
+++ b/synapse/storage/schema/state/delta/70/08_state_group_edges_unique.sql
@@ -0,0 +1,17 @@
+/* Copyright 2022 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 (ordering, update_name, progress_json) VALUES
+    (7008, 'state_group_edges_unique_idx', '{}');