core-legacy/sql/migration_1.sql
Tobias Reisinger 9d2c48d645 add: macro endpoints
add: basic macro support
fix: database locking with lock-pointer
fix: memory leaks
2020-09-04 00:28:49 +02:00

28 lines
612 B
SQL

-- migration to add macros
CREATE TABLE macros
(
id INTEGER
PRIMARY KEY
AUTOINCREMENT,
uid BLOB
NOT NULL
UNIQUE,
name VARCHAR(128)
);
CREATE TABLE macro_actions
(
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
);