22 lines
620 B
MySQL
22 lines
620 B
MySQL
|
CREATE TABLE IF NOT EXISTS users (
|
||
|
id TEXT NOT NULL PRIMARY KEY,
|
||
|
username TEXT NOT NULL UNIQUE,
|
||
|
attributes JSON NOT NULL,
|
||
|
created_at DATETIME NOT NULL,
|
||
|
updated_at DATETIME NOT NULL
|
||
|
);
|
||
|
|
||
|
CREATE TABLE IF NOT EXISTS registration_links (
|
||
|
token TEXT NOT NULL PRIMARY KEY,
|
||
|
user_id TEXT NOT NULL,
|
||
|
created_at DATETIME NOT NULL,
|
||
|
FOREIGN KEY(user_id) REFERENCES users(id)
|
||
|
);
|
||
|
|
||
|
CREATE TABLE IF NOT EXISTS user_credentials (
|
||
|
id TEXT NOT NULL PRIMARY KEY,
|
||
|
user_id TEXT NOT NULL,
|
||
|
credential JSON NOT NULL,
|
||
|
created_at DATETIME NOT NULL,
|
||
|
FOREIGN KEY(user_id) REFERENCES users(id)
|
||
|
);
|