synthwave/migrations/00001_based_update.sql
JMARyA 6051aaa985
Some checks failed
ci/woodpecker/push/deploy Pipeline failed
based update
2024-12-27 04:04:54 +01:00

13 lines
530 B
SQL

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)
);