|
@ -10,11 +10,13 @@ namespace db { |
|
|
// action should be an enum |
|
|
// action should be an enum |
|
|
m1624964657_create_alarms() : Migration() { |
|
|
m1624964657_create_alarms() : Migration() { |
|
|
db_builder::Table create_alarms = db_builder::Table::create("alarms" |
|
|
db_builder::Table create_alarms = db_builder::Table::create("alarms" |
|
|
).integer("id", "PRIMARY KEY" |
|
|
|
|
|
).integer("eventID", "REFERENCES events(uid)" |
|
|
|
|
|
|
|
|
).integer("id", "NOT NULL PRIMARY KEY" |
|
|
).text("description" |
|
|
).text("description" |
|
|
).text("action" |
|
|
).text("action" |
|
|
).text("absolute_trigger" |
|
|
).text("absolute_trigger" |
|
|
|
|
|
).integer("event_id", "NOT NULL" |
|
|
|
|
|
).fk("event_id", "events", "id", "ON DELETE CASCADE ON UPDATE NO ACTION" |
|
|
|
|
|
).constraint("event_time_unique", "event_id, absolute_trigger" |
|
|
).close(); |
|
|
).close(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|