Adds website_submissions table + shared-secret POST endpoint so the marketing site can dual-write inquiries alongside its NocoDB write. Race-safe via INSERT ... ON CONFLICT, idempotent on submission_id, refuses every request when WEBSITE_INTAKE_SECRET is unset. Also repairs pre-existing 0020/0021/0022 prevId collision (renumbered + journal re-sorted) so db:generate works again. 11 unit tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
15 lines
839 B
SQL
15 lines
839 B
SQL
-- Convert text columns to numeric. NULLs survive; empty strings become NULL;
|
|
-- whitespace is trimmed before casting so legacy data with stray spaces converts cleanly.
|
|
ALTER TABLE "berths"
|
|
ALTER COLUMN "nominal_boat_size" SET DATA TYPE numeric
|
|
USING NULLIF(TRIM("nominal_boat_size"), '')::numeric;--> statement-breakpoint
|
|
ALTER TABLE "berths"
|
|
ALTER COLUMN "nominal_boat_size_m" SET DATA TYPE numeric
|
|
USING NULLIF(TRIM("nominal_boat_size_m"), '')::numeric;--> statement-breakpoint
|
|
ALTER TABLE "berths"
|
|
ALTER COLUMN "power_capacity" SET DATA TYPE numeric
|
|
USING NULLIF(TRIM("power_capacity"), '')::numeric;--> statement-breakpoint
|
|
ALTER TABLE "berths"
|
|
ALTER COLUMN "voltage" SET DATA TYPE numeric
|
|
USING NULLIF(TRIM("voltage"), '')::numeric;--> statement-breakpoint
|
|
ALTER TABLE "berths" ADD COLUMN "status_override_mode" text; |