From 7db0e2a5ed0e3b868040367fcd3e4a9acc8d0780 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Sun, 20 Sep 2020 16:09:11 -0400 Subject: [PATCH] Fix database check --- internal/db/migrations/postgres.gen.go | 2 +- internal/db/migrations/postgres/50_session.up.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/db/migrations/postgres.gen.go b/internal/db/migrations/postgres.gen.go index 147ccc4e42..9552935ad9 100644 --- a/internal/db/migrations/postgres.gen.go +++ b/internal/db/migrations/postgres.gen.go @@ -3405,7 +3405,7 @@ begin; expiration_time wt_timestamp, -- maybe null -- limit on number of session connections allowed. default of 0 equals no limit connection_limit int not null default 1 - check(connection_limit >= 0), + check(connection_limit > 0 or connection_limit = -1), -- trust of first use token tofu_token bytea, -- will be null when session is first created -- the reason this session ended (null until terminated) diff --git a/internal/db/migrations/postgres/50_session.up.sql b/internal/db/migrations/postgres/50_session.up.sql index 94c3536a96..2845f2be07 100644 --- a/internal/db/migrations/postgres/50_session.up.sql +++ b/internal/db/migrations/postgres/50_session.up.sql @@ -133,7 +133,7 @@ begin; expiration_time wt_timestamp, -- maybe null -- limit on number of session connections allowed. default of 0 equals no limit connection_limit int not null default 1 - check(connection_limit >= 0), + check(connection_limit > 0 or connection_limit = -1), -- trust of first use token tofu_token bytea, -- will be null when session is first created -- the reason this session ended (null until terminated)