ALTER TABLE maintenance_schedules ADD COLUMN email_notifications BOOLEAN DEFAULT false;
ALTER TABLE documents ADD COLUMN email_notifications BOOLEAN DEFAULT false;

CREATE INDEX idx_maintenance_schedules_email_notifications
  ON maintenance_schedules(email_notifications) WHERE email_notifications = true AND is_active = true;
CREATE INDEX idx_documents_email_notifications
  ON documents(email_notifications) WHERE email_notifications = true AND deleted_at IS NULL;
