CREATE TABLE `activity_log` ( `id` text PRIMARY KEY NOT NULL, `organization_id` text NOT NULL, `actor_user_id` text NOT NULL, `actor_email` text NOT NULL, `action` text NOT NULL, `target_type` text, `target_id` text, `target_label` text, `metadata` text, `ip_address` text, `created_at` integer DEFAULT (cast(unixepoch('subsecond') * 1000 as integer)) NOT NULL ); --> statement-breakpoint CREATE INDEX `activity_log_org_created_at_idx` ON `activity_log` (`organization_id`,`created_at`);--> statement-breakpoint CREATE INDEX `activity_log_org_actor_idx` ON `activity_log` (`organization_id`,`actor_user_id`);