diff --git a/PROGRESS.md b/PROGRESS.md index a08f79f..d36caed 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -97,3 +97,7 @@ - Navbar: combined admin actions (approvals/users/monitoring) under a single “Admin” dropdown menu. - Pricing copy: treat listing prices as indicative “starting from” values and show starting-from line on browse cards + home latest carousel. - Site settings page added with a toggle to require login for listing contact details; contact info is now hidden from logged-out visitors. + +## 2025-12-20 — Migration history repair +- Restored missing migration `20251212_agent_billing` (agent billing columns + listing billing settings table) so Prisma history matches the DB. +- Reconciled test DB migration history: aligned checksum for `20251212_agent_billing` and marked `20260310_site_settings` and `20260311_billing_preferences` as applied to stop Prisma errors and surface listings again. diff --git a/prisma/migrations/20251212_agent_billing/migration.sql b/prisma/migrations/20251212_agent_billing/migration.sql new file mode 100644 index 0000000..685f115 --- /dev/null +++ b/prisma/migrations/20251212_agent_billing/migration.sql @@ -0,0 +1,19 @@ +-- Agent billing preferences and per-listing overrides (legacy) + +ALTER TABLE "User" +ADD COLUMN "agentBillingEnabled" BOOLEAN NOT NULL DEFAULT FALSE, +ADD COLUMN "agentBankAccount" TEXT, +ADD COLUMN "agentVatBreakdownRequired" BOOLEAN NOT NULL DEFAULT FALSE, +ADD COLUMN "agentUseListingOverrides" BOOLEAN NOT NULL DEFAULT FALSE; + +CREATE TABLE "ListingBillingSettings" ( + "id" TEXT NOT NULL, + "listingId" TEXT NOT NULL, + "bankAccount" TEXT, + "vatBreakdownRequired" BOOLEAN NOT NULL DEFAULT FALSE, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT "ListingBillingSettings_pkey" PRIMARY KEY ("id"), + CONSTRAINT "ListingBillingSettings_listingId_key" UNIQUE ("listingId"), + CONSTRAINT "ListingBillingSettings_listingId_fkey" FOREIGN KEY ("listingId") REFERENCES "Listing"("id") ON DELETE CASCADE ON UPDATE CASCADE +);