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

17 lines
400 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-11-02 18:06:50 +00:00
( id INTEGER 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
2020-11-02 18:06:50 +00:00
, member_id INTEGER NOT NULL
, started_at TIMESTAMP NOT NULL
, ended_at TIMESTAMP
, FOREIGN KEY (member_id)
REFERENCES members(id)
2020-09-13 16:07:06 +00:00
);