mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-11 11:34:23 -05:00
Correctly increment orders
This commit is contained in:
parent
3b0470dba5
commit
4b203bdba5
@ -184,7 +184,7 @@ class GroupServerStore(SQLBaseStore):
|
|||||||
txn.execute("""
|
txn.execute("""
|
||||||
INSERT INTO group_summary_room_categories
|
INSERT INTO group_summary_room_categories
|
||||||
(group_id, category_id, cat_order)
|
(group_id, category_id, cat_order)
|
||||||
SELECT ?, ?, COALESCE(MAX(cat_order), 1)
|
SELECT ?, ?, COALESCE(MAX(cat_order), 0) + 1
|
||||||
FROM group_summary_room_categories
|
FROM group_summary_room_categories
|
||||||
WHERE group_id = ? AND category_id = ?
|
WHERE group_id = ? AND category_id = ?
|
||||||
""", (group_id, category_id, group_id, category_id))
|
""", (group_id, category_id, group_id, category_id))
|
||||||
@ -457,7 +457,7 @@ class GroupServerStore(SQLBaseStore):
|
|||||||
txn.execute("""
|
txn.execute("""
|
||||||
INSERT INTO group_summary_roles
|
INSERT INTO group_summary_roles
|
||||||
(group_id, role_id, role_order)
|
(group_id, role_id, role_order)
|
||||||
SELECT ?, ?, COALESCE(MAX(role_order), 1)
|
SELECT ?, ?, COALESCE(MAX(role_order), 0) + 1
|
||||||
FROM group_summary_roles
|
FROM group_summary_roles
|
||||||
WHERE group_id = ? AND role_id = ?
|
WHERE group_id = ? AND role_id = ?
|
||||||
""", (group_id, role_id, group_id, role_id))
|
""", (group_id, role_id, group_id, role_id))
|
||||||
|
Loading…
Reference in New Issue
Block a user