CREATE TABLE "event_participants" (
	"id" serial PRIMARY KEY NOT NULL,
	"event_id" integer NOT NULL,
	"contact_id" integer,
	"business_company_id" integer,
	"name" text NOT NULL,
	"email" text,
	"phone" text,
	"position" text,
	"company" text,
	"status" text DEFAULT 'registered' NOT NULL,
	"registration_date" timestamp DEFAULT now() NOT NULL,
	"confirmation_date" timestamp,
	"notes" text,
	"created_at" timestamp DEFAULT now() NOT NULL,
	"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "event_participants" ADD CONSTRAINT "event_participants_event_id_events_id_fk" FOREIGN KEY ("event_id") REFERENCES "public"."events"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "event_participants" ADD CONSTRAINT "event_participants_contact_id_contacts_id_fk" FOREIGN KEY ("contact_id") REFERENCES "public"."contacts"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "event_participants" ADD CONSTRAINT "event_participants_business_company_id_business_companies_id_fk" FOREIGN KEY ("business_company_id") REFERENCES "public"."business_companies"("id") ON DELETE no action ON UPDATE no action;