synthwave/migrations/00001_based_update.sql

14 lines
530 B
MySQL
Raw Permalink Normal View History

2024-12-27 03:04:54 +00:00
CREATE TYPE session_kind AS ENUM ('api', 'user');
ALTER TABLE user_session
ADD COLUMN IF NOT EXISTS "created" timestamptz NOT NULL DEFAULT NOW(),
ADD COLUMN IF NOT EXISTS "csrf" UUID NOT NULL DEFAULT gen_random_uuid(),
ADD COLUMN IF NOT EXISTS "name" VARCHAR(255),
ADD COLUMN IF NOT EXISTS kind session_kind NOT NULL DEFAULT 'user';
CREATE TABLE IF NOT EXISTS user_profile_pic (
username VARCHAR(255) NOT NULL PRIMARY KEY,
"image" bytea NOT NULL,
FOREIGN KEY (username) REFERENCES users(username)
);