fix: make trigger creation idempotent
- Add DROP TRIGGER IF EXISTS before CREATE TRIGGER - Fixes 'trigger already exists' error during schema initialization - Allows schema to run multiple times safely
This commit is contained in:
@@ -443,6 +443,7 @@ END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
-- Trigger for devices table
|
||||
DROP TRIGGER IF EXISTS update_devices_updated_at ON devices;
|
||||
CREATE TRIGGER update_devices_updated_at
|
||||
BEFORE UPDATE ON devices
|
||||
FOR EACH ROW
|
||||
|
||||
Reference in New Issue
Block a user