fix: PostgreSQL trigger syntax (remove IF NOT EXISTS)
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:
1 parent
627eb8e265
commit
ad433a470f
1 file changed
+4
-2
+4
-2
@@ -228,12 +228,14 @@ BEGIN
|
||||
END;
|
||||
$$ 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
|
||||
FOR EACH ROW
|
||||
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
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION update_updated_timestamp();
|
||||
|
||||
Reference in new issue
Block a user