-- Rollback: 017_fk_indexes
-- Drop all FK indexes added in the up migration.

-- auth / user tables
DROP INDEX IF EXISTS idx_authtoken_user_id;
DROP INDEX IF EXISTS idx_userprofile_user_id;
DROP INDEX IF EXISTS idx_confirmationcode_user_id;
DROP INDEX IF EXISTS idx_passwordresetcode_user_id;
DROP INDEX IF EXISTS idx_applesocialauth_user_id;
DROP INDEX IF EXISTS idx_googlesocialauth_user_id;

-- push notification device tables
DROP INDEX IF EXISTS idx_apnsdevice_user_id;
DROP INDEX IF EXISTS idx_gcmdevice_user_id;

-- notification tables
DROP INDEX IF EXISTS idx_notificationpreference_user_id;

-- subscription tables
DROP INDEX IF EXISTS idx_subscription_user_id;

-- residence tables
DROP INDEX IF EXISTS idx_residence_owner_id;
DROP INDEX IF EXISTS idx_sharecode_residence_id;
DROP INDEX IF EXISTS idx_sharecode_created_by_id;

-- task tables
DROP INDEX IF EXISTS idx_task_created_by_id;
DROP INDEX IF EXISTS idx_task_assigned_to_id;
DROP INDEX IF EXISTS idx_task_category_id;
DROP INDEX IF EXISTS idx_task_priority_id;
DROP INDEX IF EXISTS idx_task_frequency_id;
DROP INDEX IF EXISTS idx_task_contractor_id;
DROP INDEX IF EXISTS idx_task_parent_task_id;
DROP INDEX IF EXISTS idx_completionimage_completion_id;
DROP INDEX IF EXISTS idx_document_created_by_id;
DROP INDEX IF EXISTS idx_document_task_id;
DROP INDEX IF EXISTS idx_documentimage_document_id;
DROP INDEX IF EXISTS idx_contractor_residence_id;
DROP INDEX IF EXISTS idx_reminderlog_notification_id;
