fix: PostgreSQL trigger syntax (remove IF NOT EXISTS)
All checks were successful
Deploy Development / deploy (push) Successful in 54s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s

PostgreSQL does not support IF NOT EXISTS for CREATE TRIGGER.
Use DROP TRIGGER IF EXISTS before CREATE TRIGGER instead.

Fixes: Backend crash loop due to schema.sql syntax error on line 231

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lars 2026-03-18 11:59:09 +01:00
parent 627eb8e265
commit ad433a470f

View File

@ -228,12 +228,14 @@ BEGIN
END; END;
$$ LANGUAGE plpgsql; $$ LANGUAGE plpgsql;
CREATE TRIGGER IF NOT EXISTS trigger_profiles_updated DROP TRIGGER IF EXISTS trigger_profiles_updated ON profiles;
CREATE TRIGGER trigger_profiles_updated
BEFORE UPDATE ON profiles BEFORE UPDATE ON profiles
FOR EACH ROW FOR EACH ROW
EXECUTE FUNCTION update_updated_timestamp(); EXECUTE FUNCTION update_updated_timestamp();
CREATE TRIGGER IF NOT EXISTS trigger_ai_prompts_updated DROP TRIGGER IF EXISTS trigger_ai_prompts_updated ON ai_prompts;
CREATE TRIGGER trigger_ai_prompts_updated
BEFORE UPDATE ON ai_prompts BEFORE UPDATE ON ai_prompts
FOR EACH ROW FOR EACH ROW
EXECUTE FUNCTION update_updated_timestamp(); EXECUTE FUNCTION update_updated_timestamp();