2022-07-01 19:48:14 +02:00
|
|
|
CREATE TABLE session (
|
|
|
|
sessionid varchar(36) PRIMARY KEY,
|
|
|
|
name varchar(50) NOT NULL
|
|
|
|
);
|
|
|
|
CREATE UNIQUE INDEX session_name_unique ON session(name);
|
|
|
|
|
|
|
|
CREATE TABLE window (
|
|
|
|
sessionid varchar(36) NOT NULL,
|
|
|
|
windowid varchar(36) NOT NULL,
|
|
|
|
name varchar(50) NOT NULL,
|
|
|
|
curremote varchar(50) NOT NULL,
|
|
|
|
version int NOT NULL,
|
|
|
|
PRIMARY KEY (sessionid, windowid)
|
|
|
|
);
|
|
|
|
CREATE UNIQUE INDEX window_name_unique ON window(sessionid, name);
|
|
|
|
|
2022-07-06 01:54:49 +02:00
|
|
|
CREATE TABLE remote_instance (
|
|
|
|
riid varchar(36) PRIMARY KEY,
|
|
|
|
name varchar(50) NOT NULL,
|
2022-07-01 19:48:14 +02:00
|
|
|
sessionid varchar(36) NOT NULL,
|
|
|
|
windowid varchar(36) NOT NULL,
|
|
|
|
remoteid varchar(36) NOT NULL,
|
2022-07-06 01:54:49 +02:00
|
|
|
sessionscope boolean NOT NULL,
|
|
|
|
state json NOT NULL
|
2022-07-01 19:48:14 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE line (
|
|
|
|
sessionid varchar(36) NOT NULL,
|
|
|
|
windowid varchar(36) NOT NULL,
|
|
|
|
lineid int NOT NULL,
|
|
|
|
userid varchar(36) NOT NULL,
|
|
|
|
ts bigint NOT NULL,
|
|
|
|
linetype varchar(10) NOT NULL,
|
|
|
|
text text NOT NULL,
|
|
|
|
cmdid varchar(36) NOT NULL,
|
|
|
|
PRIMARY KEY (sessionid, windowid, lineid)
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE remote (
|
|
|
|
remoteid varchar(36) PRIMARY KEY,
|
|
|
|
remotetype varchar(10) NOT NULL,
|
|
|
|
remotename varchar(50) NOT NULL,
|
2022-07-02 02:38:36 +02:00
|
|
|
autoconnect boolean NOT NULL,
|
|
|
|
|
|
|
|
-- ssh specific opts
|
|
|
|
sshhost varchar(300) NOT NULL,
|
|
|
|
sshopts varchar(300) NOT NULL,
|
|
|
|
sshidentity varchar(300) NOT NULL,
|
|
|
|
sshuser varchar(100) NOT NULL,
|
|
|
|
|
|
|
|
-- runtime data
|
2022-07-07 04:01:00 +02:00
|
|
|
lastconnectts bigint NOT NULL
|
2022-07-01 19:48:14 +02:00
|
|
|
);
|
|
|
|
|
2022-07-07 09:10:37 +02:00
|
|
|
CREATE TABLE cmd (
|
2022-07-01 19:48:14 +02:00
|
|
|
sessionid varchar(36) NOT NULL,
|
|
|
|
cmdid varchar(36) NOT NULL,
|
|
|
|
remoteid varchar(36) NOT NULL,
|
2022-07-07 09:10:37 +02:00
|
|
|
cmdstr text NOT NULL,
|
2022-07-06 01:54:49 +02:00
|
|
|
remotestate json NOT NULL,
|
2022-07-07 09:10:37 +02:00
|
|
|
termopts json NOT NULL,
|
2022-07-01 19:48:14 +02:00
|
|
|
status varchar(10) NOT NULL,
|
2022-07-07 09:10:37 +02:00
|
|
|
startpk json NOT NULL,
|
|
|
|
donepk json NOT NULL,
|
|
|
|
runout json NOT NULL,
|
2022-07-01 19:48:14 +02:00
|
|
|
PRIMARY KEY (sessionid, cmdid)
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE history (
|
|
|
|
sessionid varchar(36) NOT NULL,
|
|
|
|
windowid varchar(36) NOT NULL,
|
|
|
|
userid varchar(36) NOT NULL,
|
2022-07-01 23:07:13 +02:00
|
|
|
ts bigint NOT NULL,
|
2022-07-01 19:48:14 +02:00
|
|
|
lineid varchar(36) NOT NULL,
|
|
|
|
PRIMARY KEY (sessionid, windowid, lineid)
|
|
|
|
);
|