CREATE TABLE IF NOT EXISTS users (
    id TEXT PRIMARY KEY,
    expires_at TEXT
);

CREATE TABLE IF NOT EXISTS auth_tokens (
    token TEXT PRIMARY KEY,
    user_id TEXT NOT NULL REFERENCES users(id),
    expires_at TEXT
);

CREATE TABLE IF NOT EXISTS api_tokens (
    token TEXT PRIMARY KEY,
    user_id TEXT NOT NULL REFERENCES users(id),
    expires_at TEXT
);

CREATE INDEX IF NOT EXISTS
idx_auth_tokens_user ON auth_tokens(user_id);
CREATE INDEX IF NOT EXISTS
idx_api_tokens_user ON api_tokens(user_id);
