schema changes to support multi-connections (#372)
This commit is contained in:
3 files changed
+40
-4
No files matched your search
@@ -3152,6 +3152,15 @@ create table target_tcp (
|
||||
name text not null, -- name is not optional for a target subtype
|
||||
description text,
|
||||
default_port int, -- default_port can be null
|
||||
-- max duration of the session in seconds. default of 0 equals no limit
|
||||
session_duration_seconds int not null default 0
|
||||
check(session_duration_seconds >= 0),
|
||||
-- limit on number of session connections allowed. default of 0 equals no limit
|
||||
connection_limit int not null default 1
|
||||
check(connection_limit >= 0),
|
||||
-- connection idle timout in seconds. default of 0 equals no limit
|
||||
connection_idle_timeout_seconds int not null default 0
|
||||
check(connection_idle_timeout_seconds >= 0),
|
||||
create_time wt_timestamp,
|
||||
update_time wt_timestamp,
|
||||
version wt_version,
|
||||
@@ -3173,7 +3182,7 @@ create trigger
|
||||
immutable_columns
|
||||
before
|
||||
update on target_tcp
|
||||
for each row execute procedure immutable_columns('public_id', 'scope_id', 'create_time');
|
||||
for each row execute procedure immutable_columns('public_id', 'scope_id', 'session_duration_seconds', 'connection_limit', 'connection_idle_timeout_seconds', 'create_time');
|
||||
|
||||
create trigger
|
||||
update_version_column
|
||||
@@ -3206,6 +3215,9 @@ select
|
||||
name,
|
||||
description,
|
||||
default_port,
|
||||
session_duration_seconds,
|
||||
connection_limit,
|
||||
connection_idle_timeout_seconds,
|
||||
version,
|
||||
create_time,
|
||||
update_time,
|
||||
@@ -3395,6 +3407,12 @@ begin;
|
||||
certificate bytea not null,
|
||||
-- after this time the connection will be expired, e.g. forcefully terminated
|
||||
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),
|
||||
-- connection idle timout in seconds. default of 0 equals no limit
|
||||
connection_idle_timeout_seconds int not null default 0
|
||||
check(connection_idle_timeout_seconds >= 0),
|
||||
-- trust of first use token
|
||||
tofu_token bytea, -- will be null when session is first created
|
||||
-- the reason this session ended (null until terminated)
|
||||
@@ -3416,7 +3434,7 @@ begin;
|
||||
immutable_columns
|
||||
before
|
||||
update on session
|
||||
for each row execute procedure immutable_columns('public_id', 'certificate', 'expiration_time', 'create_time');
|
||||
for each row execute procedure immutable_columns('public_id', 'certificate', 'expiration_time', 'connection_limit', 'create_time');
|
||||
|
||||
create trigger
|
||||
update_version_column
|
||||
|
||||
@@ -99,6 +99,15 @@ create table target_tcp (
|
||||
name text not null, -- name is not optional for a target subtype
|
||||
description text,
|
||||
default_port int, -- default_port can be null
|
||||
-- max duration of the session in seconds. default of 0 equals no limit
|
||||
session_duration_seconds int not null default 0
|
||||
check(session_duration_seconds >= 0),
|
||||
-- limit on number of session connections allowed. default of 0 equals no limit
|
||||
connection_limit int not null default 1
|
||||
check(connection_limit >= 0),
|
||||
-- connection idle timout in seconds. default of 0 equals no limit
|
||||
connection_idle_timeout_seconds int not null default 0
|
||||
check(connection_idle_timeout_seconds >= 0),
|
||||
create_time wt_timestamp,
|
||||
update_time wt_timestamp,
|
||||
version wt_version,
|
||||
@@ -120,7 +129,7 @@ create trigger
|
||||
immutable_columns
|
||||
before
|
||||
update on target_tcp
|
||||
for each row execute procedure immutable_columns('public_id', 'scope_id', 'create_time');
|
||||
for each row execute procedure immutable_columns('public_id', 'scope_id', 'session_duration_seconds', 'connection_limit', 'connection_idle_timeout_seconds', 'create_time');
|
||||
|
||||
create trigger
|
||||
update_version_column
|
||||
@@ -153,6 +162,9 @@ select
|
||||
name,
|
||||
description,
|
||||
default_port,
|
||||
session_duration_seconds,
|
||||
connection_limit,
|
||||
connection_idle_timeout_seconds,
|
||||
version,
|
||||
create_time,
|
||||
update_time,
|
||||
|
||||
@@ -131,6 +131,12 @@ begin;
|
||||
certificate bytea not null,
|
||||
-- after this time the connection will be expired, e.g. forcefully terminated
|
||||
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),
|
||||
-- connection idle timout in seconds. default of 0 equals no limit
|
||||
connection_idle_timeout_seconds int not null default 0
|
||||
check(connection_idle_timeout_seconds >= 0),
|
||||
-- trust of first use token
|
||||
tofu_token bytea, -- will be null when session is first created
|
||||
-- the reason this session ended (null until terminated)
|
||||
@@ -152,7 +158,7 @@ begin;
|
||||
immutable_columns
|
||||
before
|
||||
update on session
|
||||
for each row execute procedure immutable_columns('public_id', 'certificate', 'expiration_time', 'create_time');
|
||||
for each row execute procedure immutable_columns('public_id', 'certificate', 'expiration_time', 'connection_limit', 'create_time');
|
||||
|
||||
create trigger
|
||||
update_version_column
|
||||
|
||||
Reference in new issue
Block a user