ALTER TABLE scheduled_notifications DROP CONSTRAINT IF EXISTS scheduled_notifications_created_by_fkey; ALTER TABLE scheduled_notifications ADD CONSTRAINT scheduled_notifications_created_by_fkey FOREIGN KEY (created_by) REFERENCES users(id);