diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2021-06-11 14:45:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-11 14:45:53 +0100 |
commit | c1b9922498dea4b2882d26a4eaef3e0a37e727fd (patch) | |
tree | 926ab9057e6276f7f11fb0b00d4107836b9484dd /synapse/storage/schema/common | |
parent | Use the matching complement branch when running tests in CI. (#10160) (diff) | |
download | synapse-c1b9922498dea4b2882d26a4eaef3e0a37e727fd.tar.xz |
Support for database schema version ranges (#9933)
This is essentially an implementation of the proposal made at https://hackmd.io/@richvdh/BJYXQMQHO, though the details have ended up looking slightly different.
Diffstat (limited to 'synapse/storage/schema/common')
-rw-r--r-- | synapse/storage/schema/common/schema_version.sql | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/storage/schema/common/schema_version.sql b/synapse/storage/schema/common/schema_version.sql index 42e5cb6df5..f41fde5d2d 100644 --- a/synapse/storage/schema/common/schema_version.sql +++ b/synapse/storage/schema/common/schema_version.sql @@ -20,6 +20,13 @@ CREATE TABLE IF NOT EXISTS schema_version( CHECK (Lock='X') ); +CREATE TABLE IF NOT EXISTS schema_compat_version( + Lock CHAR(1) NOT NULL DEFAULT 'X' UNIQUE, -- Makes sure this table only has one row. + -- The SCHEMA_VERSION of the oldest synapse this database can be used with + compat_version INTEGER NOT NULL, + CHECK (Lock='X') +); + CREATE TABLE IF NOT EXISTS applied_schema_deltas( version INTEGER NOT NULL, file TEXT NOT NULL, |