add: schema migration scripts
This commit is contained in:
parent
ea8cb566e9
commit
086102c2fb
3 changed files with 63 additions and 0 deletions
38
sql/migration_0.sql
Normal file
38
sql/migration_0.sql
Normal file
|
@ -0,0 +1,38 @@
|
|||
create table meta
|
||||
(
|
||||
version_num int not null
|
||||
);
|
||||
|
||||
create table controllers
|
||||
(
|
||||
id VARCHAR(33) not null
|
||||
primary key
|
||||
unique,
|
||||
name VARCHAR(128),
|
||||
ip VARCHAR(16),
|
||||
port INTEGER,
|
||||
relay_count INTEGER,
|
||||
active BOOLEAN not null
|
||||
);
|
||||
|
||||
create table relays
|
||||
(
|
||||
id INTEGER not null
|
||||
primary key
|
||||
unique,
|
||||
name VARCHAR(128),
|
||||
number INTEGER not null,
|
||||
controller_id VARCHAR(33) not null
|
||||
references controllers (id),
|
||||
active_schedule_id VARCHAR(33)
|
||||
references schedules
|
||||
);
|
||||
|
||||
create table schedules
|
||||
(
|
||||
id VARCHAR(33) not null
|
||||
primary key
|
||||
unique,
|
||||
name VARCHAR(128),
|
||||
periods BLOB
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue