feat(berths): add per-berth pricing + last_imported_at columns
Adds the 5 pricing columns surfaced by the per-berth PDFs (Phase 6b will populate them via the OCR parser) and the last_imported_at marker the NocoDB import script (Phase 0c) uses to detect human edits and skip overwriting them. - weekly_rate_high_usd / weekly_rate_low_usd - daily_rate_high_usd / daily_rate_low_usd - pricing_valid_until (date) - drives the "stale pricing" chip on the berth detail page when older than today - last_imported_at - compared against updated_at so re-running the import preserves CRM-side overrides tenure_type comment widens to include 'fee_simple' and 'strata_lot' to match the per-berth PDF tenure model; the column is plain text so no DB-level enum change is required. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
6
src/lib/db/migrations/0025_berth_pricing_columns.sql
Normal file
6
src/lib/db/migrations/0025_berth_pricing_columns.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
ALTER TABLE "berths" ADD COLUMN "weekly_rate_high_usd" numeric;--> statement-breakpoint
|
||||
ALTER TABLE "berths" ADD COLUMN "weekly_rate_low_usd" numeric;--> statement-breakpoint
|
||||
ALTER TABLE "berths" ADD COLUMN "daily_rate_high_usd" numeric;--> statement-breakpoint
|
||||
ALTER TABLE "berths" ADD COLUMN "daily_rate_low_usd" numeric;--> statement-breakpoint
|
||||
ALTER TABLE "berths" ADD COLUMN "pricing_valid_until" date;--> statement-breakpoint
|
||||
ALTER TABLE "berths" ADD COLUMN "last_imported_at" timestamp with time zone;
|
||||
10675
src/lib/db/migrations/meta/0025_snapshot.json
Normal file
10675
src/lib/db/migrations/meta/0025_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -176,6 +176,13 @@
|
||||
"when": 1777938954111,
|
||||
"tag": "0024_normalize_mooring_numbers",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 25,
|
||||
"version": "7",
|
||||
"when": 1777939212954,
|
||||
"tag": "0025_berth_pricing_columns",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user