mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-18 11:04:36 -04:00
Add unique constraint on schema_version.lock schema. Use conflict clause in sql.
This commit is contained in:
parent
b4c38738f4
commit
5eefd1f618
2 changed files with 5 additions and 4 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue