|
| 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