Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
07e931b46This file is pinned to the selected release. Download the original to open it in your design tool.
CREATE TABLE `reports` (
`id` text PRIMARY KEY NOT NULL,
`target_type` text NOT NULL,
`target_id` text NOT NULL,
`target_title` text,
`target_user_id` text,
`reporter_id` text NOT NULL,
`reason` text NOT NULL,
`detail` text,
`status` text DEFAULT 'open' NOT NULL,
`created_at` integer NOT NULL,
`resolved_at` integer,
FOREIGN KEY (`reporter_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE INDEX `reports_status_created_idx` ON `reports` (`status`,`created_at`);--> statement-breakpoint
CREATE INDEX `reports_target_user_idx` ON `reports` (`target_user_id`);