-- cleanup-orphaned-types.sql
-- Run this against your database BEFORE regenerating the migration.
-- Safe to run — all statements use IF EXISTS.

-- Orphaned enum types from failed migration attempts
DROP TYPE IF EXISTS "public"."enum_pages_blocks_lm_product_detail_section_background" CASCADE;
DROP TYPE IF EXISTS "public"."enum__pages_v_blocks_lm_product_detail_section_background" CASCADE;
DROP TYPE IF EXISTS "public"."enum_pages_blocks_lm_service_cards_cards_icon_slug" CASCADE;
DROP TYPE IF EXISTS "public"."enum__pages_v_blocks_lm_service_cards_cards_icon_slug" CASCADE;

-- Orphaned tables (if partially created)
DROP TABLE IF EXISTS "public"."_pages_v_blocks_lm_product_detail_locales" CASCADE;
DROP TABLE IF EXISTS "public"."_pages_v_blocks_lm_product_detail" CASCADE;
DROP TABLE IF EXISTS "public"."pages_blocks_lm_product_detail_locales" CASCADE;
DROP TABLE IF EXISTS "public"."pages_blocks_lm_product_detail" CASCADE;

-- Orphaned columns added to service_cards (will be re-added by fresh migration)
ALTER TABLE IF EXISTS "public"."pages_blocks_lm_service_cards_cards" DROP COLUMN IF EXISTS "icon_slug";
ALTER TABLE IF EXISTS "public"."pages_blocks_lm_service_cards_cards_locales" DROP COLUMN IF EXISTS "eyebrow";
ALTER TABLE IF EXISTS "public"."_pages_v_blocks_lm_service_cards_cards" DROP COLUMN IF EXISTS "icon_slug";
ALTER TABLE IF EXISTS "public"."_pages_v_blocks_lm_service_cards_cards_locales" DROP COLUMN IF EXISTS "eyebrow";
