farmingfamilyV1
Tables (12)
chat_history
- chat_history_id (챗봇 기록아이디) — BIGINT — Primary key — NOT NULL
- user_id (유저아이디) — BIGINT — Foreign key → users.user_id — NOT NULL
- message — TEXT — NOT NULL
- role — VARCHAR(10) — NOT NULL
- created_at — TIMESTAMP
- INDEX — idx_user_chat_history
diaries
- diary_id (일지 아이디) — BIGINT — Primary key — NOT NULL
- user_id (유저아이디) — BIGINT — Foreign key → users.user_id — NOT NULL
- title — VARCHAR(255) — NOT NULL
- content — TEXT
- image_url — VARCHAR(500)
- watered — BOOLEAN — NOT NULL
- pruned — BOOLEAN — NOT NULL
- fertilized — BOOLEAN — NOT NULL
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
- INDEX — idx_user_diary
diary_user_plant
- diary_user_plant_id (Key) — Primary key — NOT NULL
- diary_id (일지 아이디) — BIGINT — Foreign key → diaries.diary_id — NOT NULL
- user_plant_id (유저작물아이디) — Foreign key → user_plants.user_plant_id — NOT NULL
farm_info
- farm_id (토지아이디) — BIGINT — Primary key — NOT NULL
- garden_unique_id — INT — NOT NULL
- operator — VARCHAR(255)
- name — VARCHAR(255)
- road_name_address — VARCHAR(255)
- lot_number_address — VARCHAR(255)
- facilities — TEXT
- available — BOOLEAN
- contact — TEXT
- latitude — DOUBLE
- longitude — DOUBLE
- created_at — DATE
- updated_at — DATE
- image_url — VARCHAR(500)
notification
- notification_id (알림 아이디) — BIGINT — Primary key — NOT NULL
- user_id (유저아이디) — BIGINT — Foreign key → users.user_id — NOT NULL
- title — VARCHAR(255) — NOT NULL
- message — TEXT
- is_read — BOOLEAN — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- INDEX — idx_user_notification
photo_analysis
- photo_analysis_id (사진분석아이디) — BIGINT — Primary key — NOT NULL
- user_id (유저아이디) — BIGINT — Foreign key → users.user_id — NOT NULL
- image_url — VARCHAR(500) — NOT NULL
- analysis_summary — TEXT
- detected_disease (탐지된 질병) — VARCHAR(255)
- solution — TEXT
- created_at — TIMESTAMP
- INDEX — idx_user_photo_analysis
plant_info
- plant_id (작물아이디) — BIGINT — Primary key — NOT NULL
- name — VARCHAR(255) — NOT NULL
- english_name — VARCHAR(255)
- species — VARCHAR(255)
- season — VARCHAR(255)
- image_url — VARCHAR(500)
- created_at — DATE
- updated_at — DATE
refresh_tokens
- id — BIGINT — Primary key — NOT NULL
- user_id (유저아이디) — BIGINT — Foreign key → users.user_id — NOT NULL
- refresh_token — VARCHAR(512) — NOT NULL
- expires_at — TIMESTAMP — NOT NULL
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
- INDEX — idx_refresh_token_user
subscription
- subscription_id (구독관리아이디) — BIGINT — Primary key — NOT NULL
- user_id (유저아이디) — BIGINT — Foreign key → users.user_id — NOT NULL
- start_date — TIMESTAMP
- end_date — TIMESTAMP
- status — VARCHAR(20) — NOT NULL
- INDEX — idx_user_subscription
user_location
- user_location_id (유저위치아이디) — BIGINT — Primary key — NOT NULL
- user_id (유저아이디) — BIGINT — Foreign key → users.user_id — NOT NULL
- latitude — DOUBLE
- longitude — DOUBLE
- address — VARCHAR(255)
- created_at — TIMESTAMP
- INDEX — idx_user_user_location
user_plants
- user_plant_id (유저작물아이디) — Primary key — NOT NULL
- user_id (유저아이디) — BIGINT — Foreign key → users.user_id — NOT NULL
- farm_id (토지아이디) — BIGINT — Foreign key → farm_info.farm_id — NOT NULL
- plant_id (작물아이디2) — BIGINT — Foreign key → plant_info.plant_id — NOT NULL
- plant_name — VARCHAR(255)
- nickname — VARCHAR(20) — NOT NULL
- planting_place — VARCHAR(255)
- planted_date — TIMESTAMP
- notes — TEXT
- image_url — VARCHAR(500)
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
- INDEX — idx_user_plant
users
- user_id (유저아이디) — BIGINT — Primary key — NOT NULL
- email — VARCHAR(255) — NOT NULL
- password — VARCHAR(255) — NOT NULL
- nickname — VARCHAR(50) — NOT NULL
- profile_image — VARCHAR(255)
- oauth_provider — VARCHAR(20)
- oauth_id — VARCHAR(255)
- role — ENUM('USER', 'ADMIN') — NOT NULL
- fcm_token — VARCHAR(512)
- subscription_status — VARCHAR(20) — NOT NULL