asset type enum fix

This commit is contained in:
Wells Bunker 2025-09-16 08:44:06 -06:00
parent 86341c4cdb
commit 981804cb23
No known key found for this signature in database
GPG Key ID: DB16D6F2679B78FC
1 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,15 @@
-- Custom SQL migration file, put your code below! --
-- Add the 'message' value to asset_type_enum if it doesn't exist
-- This needs to be done first and committed before it can be used
DO $$
BEGIN
-- Check if 'message' value already exists in the enum
IF NOT EXISTS (SELECT 1 FROM pg_enum WHERE enumlabel = 'message' AND enumtypid = 'asset_type_enum'::regtype) THEN
ALTER TYPE "public"."asset_type_enum" ADD VALUE 'message';
END IF;
END $$;
-- Function for chats table
CREATE OR REPLACE FUNCTION sync_chats_to_text_search()
RETURNS TRIGGER AS $$