watchdogs/migrations/0006_based_update.sql
JMARyA bcb0d8738a
All checks were successful
ci/woodpecker/push/build Pipeline was successful
based update
2024-12-27 04:03:00 +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)
);