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
|
name text not null, -- name is not optional for a target subtype
|
||||||
description text,
|
description text,
|
||||||
default_port int, -- default_port can be null
|
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,
|
create_time wt_timestamp,
|
||||||
update_time wt_timestamp,
|
update_time wt_timestamp,
|
||||||
version wt_version,
|
version wt_version,
|
||||||
@@ -3173,7 +3182,7 @@ create trigger
|
|||||||
immutable_columns
|
immutable_columns
|
||||||
before
|
before
|
||||||
update on target_tcp
|
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
|
create trigger
|
||||||
update_version_column
|
update_version_column
|
||||||
@@ -3206,6 +3215,9 @@ select
|
|||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
default_port,
|
default_port,
|
||||||
|
session_duration_seconds,
|
||||||
|
connection_limit,
|
||||||
|
connection_idle_timeout_seconds,
|
||||||
version,
|
version,
|
||||||
create_time,
|
create_time,
|
||||||
update_time,
|
update_time,
|
||||||
@@ -3395,6 +3407,12 @@ begin;
|
|||||||
certificate bytea not null,
|
certificate bytea not null,
|
||||||
-- after this time the connection will be expired, e.g. forcefully terminated
|
-- after this time the connection will be expired, e.g. forcefully terminated
|
||||||
expiration_time wt_timestamp, -- maybe null
|
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
|
-- trust of first use token
|
||||||
tofu_token bytea, -- will be null when session is first created
|
tofu_token bytea, -- will be null when session is first created
|
||||||
-- the reason this session ended (null until terminated)
|
-- the reason this session ended (null until terminated)
|
||||||
@@ -3416,7 +3434,7 @@ begin;
|
|||||||
immutable_columns
|
immutable_columns
|
||||||
before
|
before
|
||||||
update on session
|
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
|
create trigger
|
||||||
update_version_column
|
update_version_column
|
||||||
|
|||||||
@@ -99,6 +99,15 @@ create table target_tcp (
|
|||||||
name text not null, -- name is not optional for a target subtype
|
name text not null, -- name is not optional for a target subtype
|
||||||
description text,
|
description text,
|
||||||
default_port int, -- default_port can be null
|
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,
|
create_time wt_timestamp,
|
||||||
update_time wt_timestamp,
|
update_time wt_timestamp,
|
||||||
version wt_version,
|
version wt_version,
|
||||||
@@ -120,7 +129,7 @@ create trigger
|
|||||||
immutable_columns
|
immutable_columns
|
||||||
before
|
before
|
||||||
update on target_tcp
|
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
|
create trigger
|
||||||
update_version_column
|
update_version_column
|
||||||
@@ -153,6 +162,9 @@ select
|
|||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
default_port,
|
default_port,
|
||||||
|
session_duration_seconds,
|
||||||
|
connection_limit,
|
||||||
|
connection_idle_timeout_seconds,
|
||||||
version,
|
version,
|
||||||
create_time,
|
create_time,
|
||||||
update_time,
|
update_time,
|
||||||
|
|||||||
@@ -131,6 +131,12 @@ begin;
|
|||||||
certificate bytea not null,
|
certificate bytea not null,
|
||||||
-- after this time the connection will be expired, e.g. forcefully terminated
|
-- after this time the connection will be expired, e.g. forcefully terminated
|
||||||
expiration_time wt_timestamp, -- maybe null
|
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
|
-- trust of first use token
|
||||||
tofu_token bytea, -- will be null when session is first created
|
tofu_token bytea, -- will be null when session is first created
|
||||||
-- the reason this session ended (null until terminated)
|
-- the reason this session ended (null until terminated)
|
||||||
@@ -152,7 +158,7 @@ begin;
|
|||||||
immutable_columns
|
immutable_columns
|
||||||
before
|
before
|
||||||
update on session
|
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
|
create trigger
|
||||||
update_version_column
|
update_version_column
|
||||||
|
|||||||
Reference in new issue
Block a user