summary refs log tree commit diff
path: root/synapse/storage/databases/main/push_rule.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2023-08-09 11:00:30 +0100
committerErik Johnston <erik@matrix.org>2023-08-09 11:00:30 +0100
commit94d4507d3558f505bdac2d9cec103665865c5d43 (patch)
tree7bf8f6cc8cc6245f9a9ae4fb77113bd28d820f94 /synapse/storage/databases/main/push_rule.py
parentMerge branch 'release-v1.89' into matrix-org-hotfixes (diff)
parentFixup changelog (diff)
downloadsynapse-94d4507d3558f505bdac2d9cec103665865c5d43.tar.xz
Merge remote-tracking branch 'origin/release-v1.90' into matrix-org-hotfixes
Diffstat (limited to 'synapse/storage/databases/main/push_rule.py')
-rw-r--r--synapse/storage/databases/main/push_rule.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/storage/databases/main/push_rule.py b/synapse/storage/databases/main/push_rule.py

index e098ceea3c..c13c0bc7d7 100644 --- a/synapse/storage/databases/main/push_rule.py +++ b/synapse/storage/databases/main/push_rule.py
@@ -560,19 +560,19 @@ class PushRuleStore(PushRulesWorkerStore): if isinstance(self.database_engine, PostgresEngine): sql = """ INSERT INTO push_rules_enable (id, user_name, rule_id, enabled) - VALUES (?, ?, ?, ?) + VALUES (?, ?, ?, 1) ON CONFLICT DO NOTHING """ elif isinstance(self.database_engine, Sqlite3Engine): sql = """ INSERT OR IGNORE INTO push_rules_enable (id, user_name, rule_id, enabled) - VALUES (?, ?, ?, ?) + VALUES (?, ?, ?, 1) """ else: raise RuntimeError("Unknown database engine") new_enable_id = self._push_rules_enable_id_gen.get_next() - txn.execute(sql, (new_enable_id, user_id, rule_id, 1)) + txn.execute(sql, (new_enable_id, user_id, rule_id)) async def delete_push_rule(self, user_id: str, rule_id: str) -> None: """