2024-10-14 20:47:45 +00:00
|
|
|
CREATE TABLE device (
|
|
|
|
id INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
node_num INTEGER UNIQUE NOT NULL, -- meshtastic device node number (my_node_num)
|
|
|
|
space VARCHAR(100) NOT NULL, -- Matrix space to use for this device
|
|
|
|
control_room VARCHAR(100) NOT NULL -- control room within the space
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE remote_user (
|
|
|
|
id INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
device INTEGER NOT NULL REFERENCES device(id),
|
|
|
|
node_id INTEGER NOT NULL,
|
|
|
|
node_short_name VARCHAR(4) NOT NULL,
|
|
|
|
node_name VARCHAR(100) NOT NULL,
|
|
|
|
room VARCHAR(100) NOT NULL
|
|
|
|
);
|
2024-10-16 06:22:07 +00:00
|
|
|
|
|
|
|
CREATE TABLE matrix_state (
|
|
|
|
id INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
key TEXT UNIQUE NOT NULL,
|
|
|
|
value TEXT NOT NULL
|
|
|
|
);
|