feat: basic user token check

This commit is contained in:
2022-03-15 15:03:58 +08:00
parent a9d7576ed4
commit e4fbbb1b7b
6 changed files with 92 additions and 38 deletions

View File

@@ -0,0 +1,2 @@
-- This file should undo anything in `up.sql`
DROP TABLE users

View File

@@ -0,0 +1,9 @@
-- Your SQL goes here
CREATE TABLE users (
id INTEGER NOT NULL PRIMARY KEY,
name VARCHAR NOT NULL UNIQUE,
token VARCHAR NOT NULL UNIQUE,
is_admin BOOLEAN NOT NULL DEFAULT FALSE
);
CREATE INDEX users_toekn_idx ON users (`token`);