CREATE TABLE `photo` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `title` varchar(255) NOT NULL COMMENT '照片标题',
    `description` text COMMENT '照片描述',
    `file_path` varchar(500) NOT NULL COMMENT '原图路径',
    `thumbnail_path` varchar(500) NOT NULL COMMENT '缩略图路径',
    `user_id` bigint NOT NULL COMMENT '用户ID',
    `category_id` bigint NOT NULL COMMENT '分类ID',
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    KEY `idx_user_id` (`user_id`),
    KEY `idx_category_id` (`category_id`),
    KEY `idx_created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='照片表';