-- Add custom domain add-on fields to Dealer model
-- These fields support the Starter Package Custom Domain Add-On feature (#436)

-- hasCustomDomainAddon: Boolean flag indicating add-on is purchased
ALTER TABLE "Dealer" ADD COLUMN "hasCustomDomainAddon" BOOLEAN NOT NULL DEFAULT false;

-- customDomainAddonSubscriptionId: Stripe subscription ID for the add-on
ALTER TABLE "Dealer" ADD COLUMN "customDomainAddonSubscriptionId" TEXT;

-- customDomainAddonStatus: Status of the add-on subscription (none|active|cancelled)
ALTER TABLE "Dealer" ADD COLUMN "customDomainAddonStatus" TEXT NOT NULL DEFAULT 'none';

-- Add unique constraint on customDomainAddonSubscriptionId
CREATE UNIQUE INDEX "Dealer_customDomainAddonSubscriptionId_key" ON "Dealer"("customDomainAddonSubscriptionId");
