CREATE TABLE "system_alerts" ( "id" bigserial PRIMARY KEY NOT NULL, "kind" text NOT NULL, "severity" text DEFAULT 'warn' NOT NULL, "connector_id" text, "message" text NOT NULL, "detail" jsonb DEFAULT '{}'::jsonb NOT NULL, "first_seen_at" timestamp with time zone DEFAULT now() NOT NULL, "last_seen_at" timestamp with time zone DEFAULT now() NOT NULL, "count" integer DEFAULT 1 NOT NULL, "status" text DEFAULT 'open' NOT NULL, "resolved_at" timestamp with time zone ); --> statement-breakpoint CREATE INDEX "system_alerts_status_idx" ON "system_alerts" USING btree ("status","kind","connector_id");--> statement-breakpoint CREATE INDEX "system_alerts_seen_idx" ON "system_alerts" USING btree ("last_seen_at");