Etiqueta fotos por zona/momento y añade tabla lead_notas
Prepara el modelo de datos para la ingesta multicanal del perfil del lead: - lead_fotos: columnas momento (foto_momento antes/despues, default antes) y zona (tipo_reforma, nullable con fallback al tipoReforma del lead). - lead_notas: tabla append-only de datos de texto por zona (ej. "suelo premium"), con origen (ep|funnel|panel) para auditar quién los aportó. - Migración 0008 + regenerado db-schema/schema.sql. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
13
mvp/b2c/drizzle/0008_sharp_bloodaxe.sql
Normal file
13
mvp/b2c/drizzle/0008_sharp_bloodaxe.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
CREATE TYPE "public"."foto_momento" AS ENUM('antes', 'despues');--> statement-breakpoint
|
||||
CREATE TABLE "lead_notas" (
|
||||
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||
"lead_id" uuid NOT NULL,
|
||||
"zona" "tipo_reforma",
|
||||
"texto" text NOT NULL,
|
||||
"origen" text DEFAULT 'ep' NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "lead_fotos" ADD COLUMN "momento" "foto_momento" DEFAULT 'antes' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "lead_fotos" ADD COLUMN "zona" "tipo_reforma";--> statement-breakpoint
|
||||
ALTER TABLE "lead_notas" ADD CONSTRAINT "lead_notas_lead_id_leads_id_fk" FOREIGN KEY ("lead_id") REFERENCES "public"."leads"("id") ON DELETE cascade ON UPDATE no action;
|
||||
1673
mvp/b2c/drizzle/meta/0008_snapshot.json
Normal file
1673
mvp/b2c/drizzle/meta/0008_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -57,6 +57,13 @@
|
||||
"when": 1780313493522,
|
||||
"tag": "0007_pale_chat",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 8,
|
||||
"version": "7",
|
||||
"when": 1780505942614,
|
||||
"tag": "0008_sharp_bloodaxe",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user