CREATE TABLE `notes` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `target_type` text NOT NULL, `target_id` integer NOT NULL, `body` text NOT NULL, `updated_by` text, `updated_at` text NOT NULL ); --> statement-breakpoint CREATE UNIQUE INDEX `notes_target_idx` ON `notes` (`target_type`,`target_id`);--> statement-breakpoint CREATE TABLE `todos` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `title` text NOT NULL, `detail` text, `due_date` text, `assignee_user_id` integer, `assignee_name` text, `target_type` text, `target_id` integer, `created_by` text, `created_at` text NOT NULL, `done_at` text, `done_by` text, FOREIGN KEY (`assignee_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null );