Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 20c76ce

Browse files
authored
Drop unused column application_services_state.last_txn (#13627)
1 parent 372136d commit 20c76ce

4 files changed

Lines changed: 59 additions & 0 deletions

File tree

changelog.d/13627.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Drop unused column `application_services_state.last_txn`.

synapse/storage/schema/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
Changes in SCHEMA_VERSION = 72:
7676
- event_edges.(room_id, is_state) are no longer written to.
7777
- Tables related to groups are dropped.
78+
- Unused column application_services_state.last_txn is dropped
7879
"""
7980

8081

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* Copyright 2022 The Matrix.org Foundation C.I.C
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
-- Drop unused column application_services_state.last_txn
17+
ALTER table application_services_state DROP COLUMN last_txn;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* Copyright 2022 The Matrix.org Foundation C.I.C
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
-- Drop unused column application_services_state.last_txn
17+
18+
CREATE TABLE application_services_state2 (
19+
as_id TEXT PRIMARY KEY NOT NULL,
20+
state VARCHAR(5),
21+
read_receipt_stream_id BIGINT,
22+
presence_stream_id BIGINT,
23+
to_device_stream_id BIGINT,
24+
device_list_stream_id BIGINT
25+
);
26+
27+
28+
INSERT INTO application_services_state2 (
29+
as_id,
30+
state,
31+
read_receipt_stream_id,
32+
presence_stream_id,
33+
to_device_stream_id,
34+
device_list_stream_id
35+
)
36+
SELECT as_id, state, read_receipt_stream_id, presence_stream_id, to_device_stream_id, device_list_stream_id
37+
FROM application_services_state;
38+
39+
DROP TABLE application_services_state;
40+
ALTER TABLE application_services_state2 RENAME TO application_services_state;

0 commit comments

Comments
 (0)