ERD
Tables (10)
car_types (차량 종류)
- id — BIGINT
- car_type_code — VARCHAR(50)
- brand — VARCHAR(100)
- model — VARCHAR(100)
- year — INT
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
companies (회사)
- id — BIGINT
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
disputes (분쟁)
- id — BIGINT
- reservation_id — BIGINT — Foreign key → reservations.id — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- status — VARCHAR(20)
- reason — TEXT
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
insurances (보험)
- id — BIGINT
- insurance_code — VARCHAR(50)
- type — VARCHAR(100)
- detail — VARCHAR(255)
- price — DOUBLE
- company_id — BIGINT — Foreign key → companies.id — NOT NULL
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
members (회원)
- id — BIGINT
- member_code — VARCHAR(50) — NOT NULL
- email — VARCHAR(100) — NOT NULL
- password — VARCHAR(255) — NOT NULL
- name — VARCHAR(100)
- country — VARCHAR(50)
- type — VARCHAR(20) — NOT NULL
- status — VARCHAR(20)
- wallet_address — VARCHAR(255)
- did — VARCHAR(255)
- license_ipfs_hash — VARCHAR(255)
- passport_ipfs_hash — VARCHAR(255)
- biz_license_ipfs_hash — VARCHAR(255)
- language — VARCHAR(10)
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
owned_vehicles (소유 차량)
- id — BIGINT
- vehicle_code — VARCHAR(50)
- plate — VARCHAR(50)
- status — VARCHAR(20)
- company_id — BIGINT — Foreign key → companies.id — NOT NULL
- car_type_id — BIGINT — Foreign key → car_types.id — NOT NULL
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
reservation_vehicles
- id — BIGINT
- reservation_id — BIGINT — Foreign key → reservations.id — NOT NULL
- owned_vehicle_id — BIGINT — Foreign key → owned_vehicles.id — NOT NULL
- created_at — TIMESTAMP
reservations (예약)
- id — BIGINT
- reservation_code — VARCHAR(50) — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- insurance_id — BIGINT — Foreign key → insurances.id
- start_date — DATE — NOT NULL
- end_date — DATE — NOT NULL
- country — VARCHAR(100)
- city — VARCHAR(100)
- status — VARCHAR(20)
- payment_token — VARCHAR(20)
- payment_amount — DOUBLE
- tx_hash — VARCHAR(255)
- pickup_inspection_code — VARCHAR(100)
- return_inspection_code — VARCHAR(100)
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
reviews (리뷰)
- id — BIGINT
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- owned_vehicle_id — BIGINT — Foreign key → owned_vehicles.id — NOT NULL
- rating — INT
- comment — TEXT — EX
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
vehicle_damage_logs (훼손 기록)
- id — BIGINT
- owned_vehicle_id — BIGINT — Foreign key → owned_vehicles.id — NOT NULL
- reservation_id — BIGINT — Foreign key → reservations.id
- damage_type — VARCHAR(100)
- location — VARCHAR(100)
- severity — VARCHAR(20)
- status — VARCHAR(20)
- estimated_cost_krw — BIGINT
- repaired_at — TIMESTAMP
- created_at — TIMESTAMP
- updated_at — TIMESTAMP