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:
2026-02-10 16:54:01 -05:00
parent 1f65933653
commit 7e7945fbb7
+1
View File
@@ -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