icy3dw/migrations/001-initial.sql

33 lines
762 B
SQL

--------------------------------------------------------------------------------
-- Up
--------------------------------------------------------------------------------
PRAGMA foreign_keys = ON;
CREATE TABLE User (
id INTEGER PRIMARY KEY,
username TEXT NOT NULL,
display_name TEXT NOT NULL,
created_at TEXT
);
CREATE TABLE Pony (
id INTEGER PRIMARY KEY,
display_name TEXT,
position TEXT,
rotation TEXT,
character TEXT,
created_at TEXT,
user_id INTEGER,
FOREIGN KEY(user_id) REFERENCES User(user_id)
);
--------------------------------------------------------------------------------
-- Down
--------------------------------------------------------------------------------
DROP TABLE User;
DROP TABLE Pony;
PRAGMA foreign_keys = OFF;