mi/migrations/2020-09-13-154110_switches/up.sql

18 lines
401 B
MySQL
Raw Normal View History

2020-09-13 16:07:06 +00:00
PRAGMA foreign_keys = ON;
CREATE TABLE IF NOT EXISTS members
2020-09-13 16:55:29 +00:00
( id INT UNIQUE NOT NULL PRIMARY KEY
2020-09-13 16:07:06 +00:00
, cmene TEXT UNIQUE NOT NULL
, picurl TEXT UNIQUE NOT NULL
);
CREATE TABLE IF NOT EXISTS switches
( id TEXT UNIQUE NOT NULL PRIMARY KEY
, who TEXT NOT NULL
, started_at TEXT NOT NULL
, ended_at TEXT
, duration TEXT NOT NULL
, FOREIGN KEY (who)
REFERENCES members(cmene)
);