TrueOil-v1.0

Tables (8)

fuel_logs

  • log_id — INT — Primary key — NOT NULL
  • user_id — INT — Foreign key → users.user_id — NOT NULL
  • station_id — VARCHAR(20) — Foreign key → gas_stations.station_id — NOT NULL
  • total_price — INT — NOT NULL
  • unit_price — INT — NOT NULL
  • current_mileage — INT — NOT NULL
  • fuel_date — DATETIME — NOT NULL

gas_stations

  • station_id — VARCHAR(20) — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • brand — VARCHAR(20) — NOT NULL
  • address — VARCHAR(255) — NOT NULL
  • lat — DOUBLE — NOT NULL
  • lon — DOUBLE — NOT NULL
  • has_car_wash — BOOLEAN — NOT NULL
  • has_repair — BOOLEAN — NOT NULL

maintenance_history

  • history_id — INT — Primary key — NOT NULL
  • user_id — INT — Foreign key → users.user_id — NOT NULL
  • item_id — INT — Foreign key → maintenance_items.item_id — NOT NULL
  • replace_date — DATE — NOT NULL
  • replace_mileage — INT — NOT NULL
  • cost — INT

maintenance_items

  • item_id — INT — Primary key — NOT NULL
  • item_name — VARCHAR(50) — NOT NULL
  • cycle_mileage — INT — NOT NULL — 표준 교체 주기(km)
  • description — VARCHAR(255)

maintenance_status

  • m_id — INT — Primary key — NOT NULL
  • user_id — INT — Foreign key → users.user_id — NOT NULL
  • item_id — INT — Foreign key → maintenance_items.item_id — NOT NULL
  • custom_cycle_mileage — INT — 사용자 지정 교체 주기
  • last_replace_mileage — INT — NOT NULL — 마지막 교체 당시 주행거리
  • health_score — DOUBLE — NOT NULL — 현재 건강도(100%에서 감소)

repair_reservations

  • res_id — INT — Primary key — NOT NULL
  • user_id — INT — Foreign key → users.user_id — NOT NULL
  • shop_name — VARCHAR(100) — NOT NULL
  • res_date — DATE — NOT NULL
  • res_time — TIME — NOT NULL
  • status — VARCHAR(20)

station_prices

  • fuel_type — VARCHAR(20) — Primary key — NOT NULL
  • station_id — VARCHAR(20) — Foreign key → gas_stations.station_id — NOT NULL
  • price — INT — NOT NULL
  • updated_at — DATETIME — NOT NULL

users

  • user_id — INT — Primary key — NOT NULL — 사용자 고유 번호
  • email — VARCHAR(50) — NOT NULL
  • password — VARCHAR(50) — NOT NULL
  • fuel_type — VARCHAR(10) — NOT NULL
  • efficiency (car_number) — DOUBLE — NOT NULL
  • current_mileage — INT — NOT NULL
  • profile_img — VARCHAR(255)
  • created_at — DATETIME — NOT NULL