ISSUE-5201: Run SQL qyery only if home_defaults_2 or main_defaults_2 exists