-- 摄影作品集项目种子数据
-- 基于当前 SQLite 数据库结构

-- 清理已有数据（保留管理员用户）
DELETE FROM photo;
DELETE FROM category WHERE id > 4; -- 保留默认的4个分类
DELETE FROM user WHERE id > 1; -- 保留管理员用户

-- 重置序列
DELETE FROM sqlite_sequence WHERE name IN ('photo', 'category', 'user');
INSERT INTO sqlite_sequence (name, seq) VALUES ('user', 1);
INSERT INTO sqlite_sequence (name, seq) VALUES ('category', 4);
INSERT INTO sqlite_sequence (name, seq) VALUES ('photo', 0);

-- 添加更多用户
INSERT INTO user (username, password, email, avatar, status, created_at, updated_at) VALUES
('photographer1', '$2a$10$fryeTxwwsFe8fIe1aekht.NV/KGr8tcWUB25EA4MMdEF5Qw5lJkPm', 'photographer1@example.com', '', 1, '2025-01-01 10:00:00', '2025-01-01 10:00:00'),
('photographer2', '$2a$10$fryeTxwwsFe8fIe1aekht.NV/KGr8tcWUB25EA4MMdEF5Qw5lJkPm', 'photographer2@example.com', '', 1, '2025-01-02 10:00:00', '2025-01-02 10:00:00'),
('nature_lover', '$2a$10$fryeTxwwsFe8fIe1aekht.NV/KGr8tcWUB25EA4MMdEF5Qw5lJkPm', 'nature@example.com', '', 1, '2025-01-03 10:00:00', '2025-01-03 10:00:00'),
('urban_explorer', '$2a$10$fryeTxwwsFe8fIe1aekht.NV/KGr8tcWUB25EA4MMdEF5Qw5lJkPm', 'urban@example.com', '', 1, '2025-01-04 10:00:00', '2025-01-04 10:00:00'),
('portrait_artist', '$2a$10$fryeTxwwsFe8fIe1aekht.NV/KGr8tcWUB25EA4MMdEF5Qw5lJkPm', 'portrait@example.com', '', 1, '2025-01-05 10:00:00', '2025-01-05 10:00:00');

-- 添加更多分类
INSERT INTO category (name, description, created_at, updated_at) VALUES
('艺术摄影', '创意艺术摄影作品', '2025-01-01 10:00:00', '2025-01-01 10:00:00'),
('宠物摄影', '可爱宠物摄影作品', '2025-01-02 10:00:00', '2025-01-02 10:00:00'),
('食物摄影', '美食摄影作品', '2025-01-03 10:00:00', '2025-01-03 10:00:00'),
('旅行摄影', '旅行纪念摄影作品', '2025-01-04 10:00:00', '2025-01-04 10:00:00'),
('黑白摄影', '经典黑白摄影作品', '2025-01-05 10:00:00', '2025-01-05 10:00:00');

-- 添加照片数据
INSERT INTO photo (title, description, file_path, thumbnail_path, user_id, category_id, created_at, updated_at) VALUES
-- 风景摄影 (category_id: 1)
('日出时分的山峰', '清晨第一缕阳光照亮雄伟的山峰，云海翻腾，景色壮观', '/uploads/photos/landscape_sunrise_001.jpg', '/uploads/thumbnails/landscape_sunrise_001_thumb.jpg', 1, 1, '2025-01-01 06:30:00', '2025-01-01 06:30:00'),
('湖光山色', '平静的湖面倒映着远山，一幅宁静的画面', '/uploads/photos/lake_mountain_002.jpg', '/uploads/thumbnails/lake_mountain_002_thumb.jpg', 3, 1, '2025-01-02 15:20:00', '2025-01-02 15:20:00'),
('森林深处', '古老的森林中，阳光透过树叶洒向大地', '/uploads/photos/forest_light_003.jpg', '/uploads/thumbnails/forest_light_003_thumb.jpg', 3, 1, '2025-01-03 11:45:00', '2025-01-03 11:45:00'),
('海天一色', '蔚蓝的大海与天空融为一体，海鸥翱翔', '/uploads/photos/seascape_004.jpg', '/uploads/thumbnails/seascape_004_thumb.jpg', 4, 1, '2025-01-04 17:10:00', '2025-01-04 17:10:00'),
('雪山之巅', '皑皑白雪覆盖的高山，纯净无瑕', '/uploads/photos/snow_mountain_005.jpg', '/uploads/thumbnails/snow_mountain_005_thumb.jpg', 2, 1, '2025-01-05 08:00:00', '2025-01-05 08:00:00'),

-- 人像摄影 (category_id: 2)
('城市女孩', '在繁华都市中展现自信的年轻女性肖像', '/uploads/photos/portrait_woman_001.jpg', '/uploads/thumbnails/portrait_woman_001_thumb.jpg', 5, 2, '2025-01-06 14:30:00', '2025-01-06 14:30:00'),
('老者的智慧', '满脸皱纹的老人，眼中闪烁着智慧的光芒', '/uploads/photos/elderly_portrait_002.jpg', '/uploads/thumbnails/elderly_portrait_002_thumb.jpg', 5, 2, '2025-01-07 16:45:00', '2025-01-07 16:45:00'),
('孩子的纯真', '天真无邪的孩子，笑容灿烂如阳光', '/uploads/photos/child_portrait_003.jpg', '/uploads/thumbnails/child_portrait_003_thumb.jpg', 2, 2, '2025-01-08 10:20:00', '2025-01-08 10:20:00'),
('艺术家的专注', '专注创作的艺术家，神情专注而深刻', '/uploads/photos/artist_portrait_004.jpg', '/uploads/thumbnails/artist_portrait_004_thumb.jpg', 5, 2, '2025-01-09 13:15:00', '2025-01-09 13:15:00'),
('情侣剪影', '夕阳下的情侣剪影，浪漫而温馨', '/uploads/photos/couple_silhouette_005.jpg', '/uploads/thumbnails/couple_silhouette_005_thumb.jpg', 1, 2, '2025-01-10 18:30:00', '2025-01-10 18:30:00'),

-- 建筑摄影 (category_id: 3)
('现代建筑群', '钢筋混凝土构成的现代都市建筑群', '/uploads/photos/modern_building_001.jpg', '/uploads/thumbnails/modern_building_001_thumb.jpg', 4, 3, '2025-01-11 09:00:00', '2025-01-11 09:00:00'),
('古典教堂', '庄严肃穆的古典教堂，哥特式建筑的典范', '/uploads/photos/gothic_church_002.jpg', '/uploads/thumbnails/gothic_church_002_thumb.jpg', 2, 3, '2025-01-12 11:30:00', '2025-01-12 11:30:00'),
('东方古建', '传统中式建筑，飞檐翘角，古韵悠长', '/uploads/photos/chinese_architecture_003.jpg', '/uploads/thumbnails/chinese_architecture_003_thumb.jpg', 1, 3, '2025-01-13 15:45:00', '2025-01-13 15:45:00'),
('摩天大楼', '直冲云霄的摩天大楼，现代都市的象征', '/uploads/photos/skyscraper_004.jpg', '/uploads/thumbnails/skyscraper_004_thumb.jpg', 4, 3, '2025-01-14 12:20:00', '2025-01-14 12:20:00'),
('桥梁艺术', '优美的桥梁设计，工程与艺术的完美结合', '/uploads/photos/bridge_art_005.jpg', '/uploads/thumbnails/bridge_art_005_thumb.jpg', 3, 3, '2025-01-15 16:00:00', '2025-01-15 16:00:00'),

-- 街拍摄影 (category_id: 4)
('匆忙的行人', '城市街头，匆忙行走的人们', '/uploads/photos/street_people_001.jpg', '/uploads/thumbnails/street_people_001_thumb.jpg', 4, 4, '2025-01-16 08:45:00', '2025-01-16 08:45:00'),
('街头艺人', '专注演奏的街头音乐家，艺术源于生活', '/uploads/photos/street_musician_002.jpg', '/uploads/thumbnails/street_musician_002_thumb.jpg', 2, 4, '2025-01-17 19:30:00', '2025-01-17 19:30:00'),
('老城小巷', '古老的石板路，两旁是传统的建筑', '/uploads/photos/old_alley_003.jpg', '/uploads/thumbnails/old_alley_003_thumb.jpg', 3, 4, '2025-01-18 14:15:00', '2025-01-18 14:15:00'),
('霓虹夜色', '夜晚的城市，霓虹灯闪烁，光影交错', '/uploads/photos/neon_night_004.jpg', '/uploads/thumbnails/neon_night_004_thumb.jpg', 4, 4, '2025-01-19 21:00:00', '2025-01-19 21:00:00'),
('市集生活', '热闹的市集，展现城市生活的多样性', '/uploads/photos/market_life_005.jpg', '/uploads/thumbnails/market_life_005_thumb.jpg', 1, 4, '2025-01-20 10:30:00', '2025-01-20 10:30:00'),

-- 艺术摄影 (category_id: 5)
('光影实验', '创意光影效果，展现摄影的艺术魅力', '/uploads/photos/light_experiment_001.jpg', '/uploads/thumbnails/light_experiment_001_thumb.jpg', 2, 5, '2025-01-21 13:45:00', '2025-01-21 13:45:00'),
('抽象构图', '独特的抽象构图，考验观者的想象力', '/uploads/photos/abstract_composition_002.jpg', '/uploads/thumbnails/abstract_composition_002_thumb.jpg', 6, 5, '2025-01-22 16:20:00', '2025-01-22 16:20:00'),
('色彩游戏', '丰富的色彩搭配，营造梦幻般的视觉效果', '/uploads/photos/color_play_003.jpg', '/uploads/thumbnails/color_play_003_thumb.jpg', 3, 5, '2025-01-23 11:10:00', '2025-01-23 11:10:00'),

-- 宠物摄影 (category_id: 6)
('可爱金毛', '活泼可爱的金毛犬，眼神纯真友善', '/uploads/photos/golden_retriever_001.jpg', '/uploads/thumbnails/golden_retriever_001_thumb.jpg', 3, 6, '2025-01-24 09:15:00', '2025-01-24 09:15:00'),
('优雅猫咪', '优雅的猫咪，姿态高贵，眼神神秘', '/uploads/photos/elegant_cat_002.jpg', '/uploads/thumbnails/elegant_cat_002_thumb.jpg', 2, 6, '2025-01-25 15:30:00', '2025-01-25 15:30:00'),
('顽皮小狗', '顽皮的小狗在草地上奔跑，充满活力', '/uploads/photos/playful_puppy_003.jpg', '/uploads/thumbnails/playful_puppy_003_thumb.jpg', 6, 6, '2025-01-26 12:45:00', '2025-01-26 12:45:00'),

-- 食物摄影 (category_id: 7)
('精致甜点', '精美的法式甜点，色彩搭配完美', '/uploads/photos/french_dessert_001.jpg', '/uploads/thumbnails/french_dessert_001_thumb.jpg', 1, 7, '2025-01-27 14:00:00', '2025-01-27 14:00:00'),
('中式佳肴', '传统中式菜肴，色香味俱全', '/uploads/photos/chinese_cuisine_002.jpg', '/uploads/thumbnails/chinese_cuisine_002_thumb.jpg', 4, 7, '2025-01-28 18:15:00', '2025-01-28 18:15:00'),
('意式咖啡', '浓香的意式咖啡，泡沫艺术精美', '/uploads/photos/italian_coffee_003.jpg', '/uploads/thumbnails/italian_coffee_003_thumb.jpg', 2, 7, '2025-01-29 08:30:00', '2025-01-29 08:30:00'),

-- 旅行摄影 (category_id: 8)
('巴黎铁塔', '经典的巴黎埃菲尔铁塔，浪漫之都的象征', '/uploads/photos/eiffel_tower_001.jpg', '/uploads/thumbnails/eiffel_tower_001_thumb.jpg', 3, 8, '2025-01-30 16:45:00', '2025-01-30 16:45:00'),
('日本庭园', '宁静的日式庭园，禅意盎然', '/uploads/photos/japanese_garden_002.jpg', '/uploads/thumbnails/japanese_garden_002_thumb.jpg', 5, 8, '2025-01-31 10:20:00', '2025-01-31 10:20:00'),
('意大利小镇', '色彩斑斓的意大利沿海小镇', '/uploads/photos/italian_town_003.jpg', '/uploads/thumbnails/italian_town_003_thumb.jpg', 1, 8, '2025-02-01 13:30:00', '2025-02-01 13:30:00'),

-- 黑白摄影 (category_id: 9)
('经典肖像', '经典的黑白人像摄影，突出情感表达', '/uploads/photos/classic_portrait_bw_001.jpg', '/uploads/thumbnails/classic_portrait_bw_001_thumb.jpg', 5, 9, '2025-02-02 11:00:00', '2025-02-02 11:00:00'),
('建筑线条', '黑白建筑摄影，突出线条和结构美', '/uploads/photos/architecture_lines_bw_002.jpg', '/uploads/thumbnails/architecture_lines_bw_002_thumb.jpg', 4, 9, '2025-02-03 14:45:00', '2025-02-03 14:45:00'),
('街头纪实', '黑白街头纪实摄影，记录真实的生活', '/uploads/photos/street_documentary_bw_003.jpg', '/uploads/thumbnails/street_documentary_bw_003_thumb.jpg', 2, 9, '2025-02-04 17:20:00', '2025-02-04 17:20:00');

-- 创建用户统计视图（可选）
-- 注意：SQLite 不支持复杂的视图操作，这里仅作示例
-- 实际统计可以在应用层计算

-- 种子数据统计
-- 总用户数: 6 (1个管理员 + 5个摄影师)
-- 总分类数: 10 (4个默认 + 6个新增)
-- 总照片数: 30 (涵盖所有分类)
-- 
-- 每个分类的照片数量:
-- 风景摄影: 5张
-- 人像摄影: 5张
-- 建筑摄影: 5张
-- 街拍摄影: 5张
-- 艺术摄影: 3张
-- 宠物摄影: 3张
-- 食物摄影: 3张
-- 旅行摄影: 3张
-- 黑白摄影: 3张
-- 
-- 每个用户的照片数量:
-- admin: 5张
-- photographer1: 3张
-- photographer2: 6张
-- nature_lover: 5张
-- urban_explorer: 6张
-- portrait_artist: 5张