2022-07-01 19:50:09 +02:00
|
|
|
CREATE TABLE schema_migrations (version uint64,dirty bool);
|
|
|
|
CREATE UNIQUE INDEX version_unique ON schema_migrations (version);
|
2022-08-17 21:24:09 +02:00
|
|
|
CREATE TABLE client (
|
|
|
|
userid varchar(36) NOT NULL,
|
|
|
|
userpublickeybytes blob NOT NULL,
|
|
|
|
userprivatekeybytes blob NOT NULL
|
|
|
|
);
|
2022-07-01 19:50:09 +02:00
|
|
|
CREATE TABLE session (
|
|
|
|
sessionid varchar(36) PRIMARY KEY,
|
2022-08-08 17:34:59 +02:00
|
|
|
name varchar(50) NOT NULL,
|
|
|
|
sessionidx int NOT NULL,
|
|
|
|
activescreenid varchar(36) NOT NULL,
|
2022-08-17 21:24:09 +02:00
|
|
|
notifynum int NOT NULL,
|
|
|
|
owneruserid varchar(36) NOT NULL,
|
|
|
|
sharemode varchar(12) NOT NULL,
|
|
|
|
accesskey varchar(36) NOT NULL
|
2022-07-01 19:50:09 +02:00
|
|
|
);
|
|
|
|
CREATE TABLE window (
|
|
|
|
sessionid varchar(36) NOT NULL,
|
|
|
|
windowid varchar(36) NOT NULL,
|
|
|
|
curremote varchar(50) NOT NULL,
|
2022-08-08 17:34:59 +02:00
|
|
|
winopts json NOT NULL,
|
2022-08-17 21:24:09 +02:00
|
|
|
owneruserid varchar(36) NOT NULL,
|
|
|
|
sharemode varchar(12) NOT NULL,
|
|
|
|
shareopts json NOT NULL,
|
2022-07-01 19:50:09 +02:00
|
|
|
PRIMARY KEY (sessionid, windowid)
|
|
|
|
);
|
2022-08-08 17:34:59 +02:00
|
|
|
CREATE TABLE screen (
|
|
|
|
sessionid varchar(36) NOT NULL,
|
|
|
|
screenid varchar(36) NOT NULL,
|
|
|
|
name varchar(50) NOT NULL,
|
|
|
|
activewindowid varchar(36) NOT NULL,
|
|
|
|
screenidx int NOT NULL,
|
|
|
|
screenopts json NOT NULL,
|
2022-08-17 21:24:09 +02:00
|
|
|
owneruserid varchar(36) NOT NULL,
|
|
|
|
sharemode varchar(12) NOT NULL,
|
2022-08-08 17:34:59 +02:00
|
|
|
PRIMARY KEY (sessionid, screenid)
|
|
|
|
);
|
|
|
|
CREATE TABLE screen_window (
|
|
|
|
sessionid varchar(36) NOT NULL,
|
|
|
|
screenid varchar(36) NOT NULL,
|
|
|
|
windowid varchar(36) NOT NULL,
|
|
|
|
name varchar(50) NOT NULL,
|
|
|
|
layout json NOT NULL,
|
|
|
|
PRIMARY KEY (sessionid, screenid, windowid)
|
|
|
|
);
|
|
|
|
CREATE TABLE remote_instance (
|
|
|
|
riid varchar(36) PRIMARY KEY,
|
|
|
|
name varchar(50) NOT NULL,
|
2022-07-01 19:50:09 +02:00
|
|
|
sessionid varchar(36) NOT NULL,
|
|
|
|
windowid varchar(36) NOT NULL,
|
|
|
|
remoteid varchar(36) NOT NULL,
|
2022-08-08 17:34:59 +02:00
|
|
|
sessionscope boolean NOT NULL,
|
|
|
|
state json NOT NULL
|
2022-07-01 19:50:09 +02:00
|
|
|
);
|
|
|
|
CREATE TABLE line (
|
|
|
|
sessionid varchar(36) NOT NULL,
|
|
|
|
windowid varchar(36) NOT NULL,
|
2022-08-17 21:24:09 +02:00
|
|
|
lineid varchar(36) NOT NULL,
|
2022-07-01 19:50:09 +02:00
|
|
|
userid varchar(36) NOT NULL,
|
|
|
|
ts bigint NOT NULL,
|
|
|
|
linetype varchar(10) NOT NULL,
|
|
|
|
text text NOT NULL,
|
|
|
|
cmdid varchar(36) NOT NULL,
|
2022-08-24 06:05:49 +02:00
|
|
|
ephemeral boolean NOT NULL,
|
2022-07-01 19:50:09 +02:00
|
|
|
PRIMARY KEY (sessionid, windowid, lineid)
|
|
|
|
);
|
|
|
|
CREATE TABLE remote (
|
|
|
|
remoteid varchar(36) PRIMARY KEY,
|
2022-08-17 21:24:09 +02:00
|
|
|
physicalid varchar(36) NOT NULL,
|
2022-07-01 19:50:09 +02:00
|
|
|
remotetype varchar(10) NOT NULL,
|
2022-08-17 21:24:09 +02:00
|
|
|
remotealias varchar(50) NOT NULL,
|
|
|
|
remotecanonicalname varchar(200) NOT NULL,
|
|
|
|
remotesudo boolean NOT NULL,
|
|
|
|
remoteuser varchar(50) NOT NULL,
|
|
|
|
remotehost varchar(200) NOT NULL,
|
2022-08-21 21:31:29 +02:00
|
|
|
connectmode varchar(20) NOT NULL,
|
2022-08-08 17:34:59 +02:00
|
|
|
initpk json NOT NULL,
|
|
|
|
sshopts json NOT NULL,
|
2022-08-21 21:31:29 +02:00
|
|
|
remoteopts json NOT NULL,
|
2022-08-08 17:34:59 +02:00
|
|
|
lastconnectts bigint NOT NULL
|
2022-07-01 19:50:09 +02:00
|
|
|
);
|
2022-08-08 17:34:59 +02:00
|
|
|
CREATE TABLE cmd (
|
2022-07-01 19:50:09 +02:00
|
|
|
sessionid varchar(36) NOT NULL,
|
|
|
|
cmdid varchar(36) NOT NULL,
|
|
|
|
remoteid varchar(36) NOT NULL,
|
2022-08-08 17:34:59 +02:00
|
|
|
cmdstr text NOT NULL,
|
|
|
|
remotestate json NOT NULL,
|
|
|
|
termopts json NOT NULL,
|
2022-07-01 19:50:09 +02:00
|
|
|
status varchar(10) NOT NULL,
|
2022-08-08 17:34:59 +02:00
|
|
|
startpk json NOT NULL,
|
|
|
|
donepk json NOT NULL,
|
|
|
|
runout json NOT NULL,
|
|
|
|
usedrows int NOT NULL,
|
2022-08-24 06:05:49 +02:00
|
|
|
prompt text NOT NULL,
|
2022-07-01 19:50:09 +02:00
|
|
|
PRIMARY KEY (sessionid, cmdid)
|
|
|
|
);
|
|
|
|
CREATE TABLE history (
|
2022-08-11 21:07:41 +02:00
|
|
|
historyid varchar(36) PRIMARY KEY,
|
|
|
|
ts bigint NOT NULL,
|
|
|
|
userid varchar(36) NOT NULL,
|
2022-07-01 19:50:09 +02:00
|
|
|
sessionid varchar(36) NOT NULL,
|
2022-08-11 21:07:41 +02:00
|
|
|
screenid varchar(36) NOT NULL,
|
2022-07-01 19:50:09 +02:00
|
|
|
windowid varchar(36) NOT NULL,
|
2022-08-11 21:07:41 +02:00
|
|
|
lineid int NOT NULL,
|
2022-08-12 08:45:15 +02:00
|
|
|
haderror boolean NOT NULL,
|
2022-08-11 21:07:41 +02:00
|
|
|
cmdid varchar(36) NOT NULL,
|
|
|
|
cmdstr text NOT NULL
|
2022-07-01 19:50:09 +02:00
|
|
|
);
|