mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-30 12:55:02 +00:00
migrate domna_survey_required -> domna_survey_type
Drops the too-coarse boolean column and adds a free-text `domna_survey_type` column on hubspot_deal_data so an approver can record the survey kind directly. Updates the Drizzle schema, the HubspotDeal type, and the live-tracking page mapping to expose the new column. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
3070f2c763
commit
73a365468a
6 changed files with 8758 additions and 9 deletions
2
src/app/db/migrations/0193_domna_survey_type.sql
Normal file
2
src/app/db/migrations/0193_domna_survey_type.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE "hubspot_deal_data" DROP COLUMN IF EXISTS "domna_survey_required";--> statement-breakpoint
|
||||
ALTER TABLE "hubspot_deal_data" ADD COLUMN "domna_survey_type" text;
|
||||
8746
src/app/db/migrations/meta/0193_snapshot.json
Normal file
8746
src/app/db/migrations/meta/0193_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1352,6 +1352,13 @@
|
|||
"when": 1777576507360,
|
||||
"tag": "0192_colorful_quasimodo",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 193,
|
||||
"version": "7",
|
||||
"when": 1777750000000,
|
||||
"tag": "0193_domna_survey_type",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { pgTable, uuid, text, timestamp, boolean } from "drizzle-orm/pg-core";
|
||||
import { pgTable, uuid, text, timestamp } from "drizzle-orm/pg-core";
|
||||
import { InferModel } from "drizzle-orm";
|
||||
|
||||
export const hubspotDealData = pgTable("hubspot_deal_data", {
|
||||
|
|
@ -66,7 +66,7 @@ export const hubspotDealData = pgTable("hubspot_deal_data", {
|
|||
propertyHaltedReason: text("property_halted_reason"),
|
||||
technicalApprovedMeasuresForInstall: text("technical_approved_measures_for_install"),
|
||||
sentToInstallerForPricing: timestamp("sent_to_installer_for_pricing", { precision: 6, withTimezone: true }),
|
||||
domnaSurveyRequired: boolean("domna_survey_required"),
|
||||
domnaSurveyType: text("domna_survey_type"),
|
||||
domnaSurveyDate: timestamp("domna_survey_date", { precision: 6, withTimezone: true }),
|
||||
|
||||
createdAt: timestamp("created_at", { precision: 6, withTimezone: true })
|
||||
|
|
|
|||
|
|
@ -84,10 +84,7 @@ function mapDbRowToHubspotDeal(row: DealRow): HubspotDeal {
|
|||
propertyHaltedDate: d.propertyHaltedDate,
|
||||
propertyHaltedReason: d.propertyHaltedReason,
|
||||
technicalApprovedMeasuresForInstall: d.technicalApprovedMeasuresForInstall,
|
||||
// domna_survey_type column does not exist on the schema yet (slice 7) —
|
||||
// surface null and let the drawer fall back to the legacy boolean.
|
||||
domnaSurveyType: null,
|
||||
domnaSurveyRequired: d.domnaSurveyRequired,
|
||||
domnaSurveyType: d.domnaSurveyType,
|
||||
domnaSurveyDate: d.domnaSurveyDate,
|
||||
createdAt: d.createdAt,
|
||||
updatedAt: d.updatedAt,
|
||||
|
|
|
|||
|
|
@ -61,10 +61,7 @@ export type HubspotDeal = {
|
|||
propertyHaltedDate: Date | null;
|
||||
propertyHaltedReason: string | null;
|
||||
technicalApprovedMeasuresForInstall: string | null;
|
||||
// domnaSurveyType is the new text column added in slice 7. It may not yet
|
||||
// exist in the schema; until then the legacy boolean is used as a fallback.
|
||||
domnaSurveyType: string | null;
|
||||
domnaSurveyRequired: boolean | null;
|
||||
domnaSurveyDate: Date | null;
|
||||
|
||||
createdAt: Date;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue