2020-08-29 20:58:02 +00:00
|
|
|
-- migration to add macros
|
|
|
|
|
|
|
|
CREATE TABLE macros
|
|
|
|
(
|
|
|
|
id INTEGER
|
|
|
|
PRIMARY KEY
|
|
|
|
AUTOINCREMENT,
|
|
|
|
uid BLOB
|
|
|
|
NOT NULL
|
|
|
|
UNIQUE,
|
|
|
|
name VARCHAR(128)
|
|
|
|
);
|
|
|
|
|
2020-09-03 22:28:49 +00:00
|
|
|
CREATE TABLE macro_actions
|
2020-08-29 20:58:02 +00:00
|
|
|
(
|
|
|
|
macro_id INTEGER
|
|
|
|
NOT NULL
|
|
|
|
REFERENCES macros (id)
|
|
|
|
ON DELETE CASCADE,
|
|
|
|
relay_id INTEGER
|
|
|
|
REFERENCES relays (id)
|
|
|
|
ON DELETE CASCADE,
|
|
|
|
schedule_id INTEGER
|
|
|
|
REFERENCES schedules (id)
|
|
|
|
ON DELETE CASCADE,
|
|
|
|
weekday SMALLINT
|
|
|
|
NOT NULL
|
|
|
|
);
|