UPDATE: fix bug
All checks were successful
Build and Release / release (push) Successful in 1m33s

This commit is contained in:
2026-04-16 10:19:17 +07:00
parent 4e1e9892ac
commit ae1c9473fc
9 changed files with 16 additions and 9 deletions

View File

@@ -15,6 +15,7 @@ CREATE TABLE IF NOT EXISTS users (
updated_at TIMESTAMPTZ DEFAULT now()
);
ALTER TABLE users DROP CONSTRAINT IF EXISTS check_auth_provider;
ALTER TABLE users ADD CONSTRAINT check_auth_provider
CHECK (auth_provider IN ('local', 'google', 'facebook', 'github'));

View File

@@ -1,6 +1,6 @@
CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE TABLE medias (
CREATE TABLE IF NOT EXISTS medias (
id UUID PRIMARY KEY DEFAULT uuidv7(),
user_id UUID REFERENCES users(id) ON DELETE CASCADE,
storage_key VARCHAR(255) UNIQUE NOT NULL,

View File

@@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS user_roles (
PRIMARY KEY (user_id, role_id)
);
CREATE TABLE medias (
CREATE TABLE IF NOT EXISTS medias (
id UUID PRIMARY KEY DEFAULT uuidv7(),
user_id UUID REFERENCES users(id) ON DELETE CASCADE,
storage_key VARCHAR(255) UNIQUE NOT NULL,