retain expired session exclusivity

This commit is contained in:
Tomas Kopecek 2022-12-12 12:05:23 +01:00
parent 35070f6ba2
commit 067e294c6c
3 changed files with 13 additions and 16 deletions

View file

@ -122,10 +122,8 @@ CREATE TABLE sessions (
closed BOOLEAN NOT NULL DEFAULT FALSE,
CONSTRAINT no_exclusive_subsessions CHECK (
master IS NULL OR "exclusive" IS NULL),
CONSTRAINT exclusive_expired_sane CHECK (
expired IS FALSE OR "exclusive" IS NULL),
CONSTRAINT no_closed_exclusive CHECK (
closed IS FALSE OR "exclusive" IS NULL),
CONSTRAINT no_closed_exclusive CHECK (
closed IS FALSE OR "exclusive" IS NULL),
UNIQUE (user_id,exclusive)
) WITHOUT OIDS;
CREATE INDEX sessions_master ON sessions(master);