feat(db): add userFiles table and migration

Introduces the user_files table to track uploaded files per user,
including metadata fields for dimensions, versioning, and tool chains.
This commit is contained in:
Siddharth Kumar Sah
2026-03-26 01:10:50 +08:00
parent c8d2a3f439
commit dda37e90cc
4 changed files with 554 additions and 0 deletions
@@ -0,0 +1,15 @@
CREATE TABLE `user_files` (
`id` text PRIMARY KEY NOT NULL,
`user_id` text,
`original_name` text NOT NULL,
`stored_name` text NOT NULL,
`mime_type` text NOT NULL,
`size` integer NOT NULL,
`width` integer,
`height` integer,
`version` integer DEFAULT 1 NOT NULL,
`parent_id` text,
`tool_chain` text,
`created_at` integer NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);