-- P1-9: 多公积金比例账户
-- 给 HousingFundConfig 增加 accountType 字段，支持基本公积金/补充公积金

-- 1. 添加列，默认值 BASIC
ALTER TABLE "HousingFundConfig" ADD COLUMN "accountType" TEXT NOT NULL DEFAULT 'BASIC';

-- 2. 删除旧唯一约束
ALTER TABLE "HousingFundConfig" DROP CONSTRAINT "HousingFundConfig_orgId_city_effectiveFrom_key";

-- 3. 添加新唯一约束（包含 accountType）
ALTER TABLE "HousingFundConfig" ADD CONSTRAINT "HousingFundConfig_orgId_city_accountType_effectiveFrom_key" UNIQUE ("orgId", "city", "accountType", "effectiveFrom");
