-- Hapus open_house dan close_house rows dengan effective_date baru
DELETE FROM house_depreciation_standards
WHERE house_type IN ('open_house', 'close_house') AND effective_date = '2026-05-20';

-- Hapus kolom multiplication_percentage
ALTER TABLE house_depreciation_standards DROP COLUMN multiplication_percentage;

-- Invalidate snapshot cache
DELETE FROM farm_depreciation_snapshots;

-- Kembalikan unique constraint lama
ALTER TABLE house_depreciation_standards
    DROP CONSTRAINT house_depreciation_standards_house_type_day_eff_unique;

ALTER TABLE house_depreciation_standards
    ADD CONSTRAINT house_depreciation_standards_house_type_day_unique
    UNIQUE (house_type, day);
