diff options
author | Erik Johnston <erik@matrix.org> | 2015-03-04 13:52:18 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-03-04 13:52:18 +0000 |
commit | 5eefd1f618a19cc27cfdaf915dc3abd3720cd0e7 (patch) | |
tree | 4799fd86330ca135e4a17275b7ab6b92b493b294 /synapse/storage/schema/schema_version.sql | |
parent | Change to use logger in db upgrade script (diff) | |
download | synapse-5eefd1f618a19cc27cfdaf915dc3abd3720cd0e7.tar.xz |
Add unique constraint on schema_version.lock schema. Use conflict clause in sql.
Diffstat (limited to 'synapse/storage/schema/schema_version.sql')
-rw-r--r-- | synapse/storage/schema/schema_version.sql | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/schema/schema_version.sql b/synapse/storage/schema/schema_version.sql index 83a8c7b7ce..20b1481ba5 100644 --- a/synapse/storage/schema/schema_version.sql +++ b/synapse/storage/schema/schema_version.sql @@ -17,7 +17,8 @@ CREATE TABLE IF NOT EXISTS schema_version( Lock char(1) NOT NULL DEFAULT 'X', -- Makes sure this table only has one row. version INTEGER NOT NULL, upgraded BOOL NOT NULL, -- Whether we reached this version from an upgrade or an initial schema. - CONSTRAINT schema_version_lock CHECK (Lock='X') ON CONFLICT REPLACE + CONSTRAINT schema_version_lock_x CHECK (Lock='X') + CONSTRAINT schema_version_lock_uniq UNIQUE (Lock) ); CREATE TABLE IF NOT EXISTS schema_deltas( |