CREATE TABLE `leads` (
	`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
	`public_id` text NOT NULL,
	`event_name` text DEFAULT 'COMANDO' NOT NULL,
	`journey` text DEFAULT 'waitlist' NOT NULL,
	`full_name` text NOT NULL,
	`email` text NOT NULL,
	`phone` text,
	`segment` text NOT NULL,
	`role` text,
	`company` text,
	`consent_service` integer DEFAULT false NOT NULL,
	`consent_email_marketing` integer DEFAULT false NOT NULL,
	`consent_whatsapp` integer DEFAULT false NOT NULL,
	`consent_version` text DEFAULT '2026-08-31.v1' NOT NULL,
	`source_path` text DEFAULT '/' NOT NULL,
	`utm_source` text,
	`utm_medium` text,
	`utm_campaign` text,
	`utm_content` text,
	`utm_term` text,
	`creative_id` text,
	`status` text DEFAULT 'new' NOT NULL,
	`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `leads_public_id_unique` ON `leads` (`public_id`);--> statement-breakpoint
CREATE INDEX `leads_email_idx` ON `leads` (`email`);--> statement-breakpoint
CREATE INDEX `leads_segment_idx` ON `leads` (`segment`);--> statement-breakpoint
CREATE INDEX `leads_created_at_idx` ON `leads` (`created_at`);