|
| 1 | +/* Copyright 2021 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 | +-- This migration is closely related to '01recreate_stream_ordering.sql.postgres'. |
| 17 | +-- |
| 18 | +-- It updates the other tables which use an INTEGER to refer to a stream ordering. |
| 19 | +-- These tables are all small enough that a re-create is tractable. |
| 20 | +ALTER TABLE pushers ALTER COLUMN last_stream_ordering SET DATA TYPE BIGINT; |
| 21 | +ALTER TABLE federation_stream_position ALTER COLUMN stream_id SET DATA TYPE BIGINT; |
| 22 | + |
| 23 | +-- these aren't actually event stream orderings, but they are numbers where 2 billion |
| 24 | +-- is a bit limiting, application_services_state is tiny, and I don't want to ever have |
| 25 | +-- to do this again. |
| 26 | +ALTER TABLE application_services_state ALTER COLUMN last_txn SET DATA TYPE BIGINT; |
| 27 | +ALTER TABLE application_services_state ALTER COLUMN read_receipt_stream_id SET DATA TYPE BIGINT; |
| 28 | +ALTER TABLE application_services_state ALTER COLUMN presence_stream_id SET DATA TYPE BIGINT; |
| 29 | + |
| 30 | + |
0 commit comments