-- AlterTable
ALTER TABLE "Plan" ADD COLUMN "featuredListingsQuota" INTEGER;

-- Seed defaults per tier (keep in sync with prisma/seed.ts)
UPDATE "Plan" SET "featuredListingsQuota" = 0 WHERE "tier" = 'FREE' AND "featuredListingsQuota" IS NULL;
UPDATE "Plan" SET "featuredListingsQuota" = 5 WHERE "tier" = 'AGENT_PRO' AND "featuredListingsQuota" IS NULL;
UPDATE "Plan" SET "featuredListingsQuota" = 10 WHERE "tier" = 'INVESTOR' AND "featuredListingsQuota" IS NULL;
-- ENTERPRISE intentionally left NULL (treated as unlimited by CheckQuotaHandler)

-- AlterEnum: admin audit actions for featured listings
ALTER TYPE "AdminAction" ADD VALUE IF NOT EXISTS 'LISTING_FEATURED';
ALTER TYPE "AdminAction" ADD VALUE IF NOT EXISTS 'LISTING_UNFEATURED';
