KW Partnership ERD v2

Tables (16)

BENEFIT

  • benefit_id — BIGINT
  • store_id — BIGINT — Foreign key → STORE.store_id
  • description — TEXT
  • is_school_wide — BOOLEAN
  • start_date — DATE
  • end_date — DATE
  • is_active — BOOLEAN

BENEFIT_COLLEGE

  • benefit_id — BIGINT — Foreign key → BENEFIT.benefit_id
  • college_id — BIGINT — Foreign key → COLLEGE.college_id

BENEFIT_DEPARTMENT

  • benefit_id — BIGINT — Foreign key → BENEFIT.benefit_id
  • department_id — BIGINT — Foreign key → DEPARTMENT.department_id

BENEFIT_USAGE

  • usage_id — BIGINT
  • user_id — BIGINT — Foreign key → USER.user_id
  • store_id — BIGINT — Foreign key → STORE.store_id
  • benefit_id — BIGINT — Foreign key → BENEFIT.benefit_id
  • used_at — TIMESTAMP
  • status — VARCHAR

CATEGORY

  • category_id — BIGINT
  • name — VARCHAR

COLLEGE

  • college_id — BIGINT
  • name — VARCHAR

DEPARTMENT

  • department_id — BIGINT
  • college_id — BIGINT — Foreign key → COLLEGE.college_id
  • name — VARCHAR

EMAIL_VERIFICATION

  • id — BIGINT
  • email — VARCHAR
  • code — VARCHAR
  • expires_at — TIMESTAMP
  • is_used — BOOLEAN
  • created_at — TIMESTAMP

FAVORITE

  • user_id — BIGINT — Foreign key → USER.user_id
  • store_id — BIGINT — Foreign key → STORE.store_id
  • created_at — TIMESTAMP

LIKE (Untitled)

    MENU

    • menu_id — BIGINT
    • store_id — BIGINT — Foreign key → STORE.store_id
    • name — VARCHAR
    • image_url — VARCHAR
    • is_representative — BOOLEAN
    • display_order — INT

    OPERATOR_PROFILE

    • user_id — BIGINT — Foreign key → USER.user_id
    • store_id — BIGINT — Foreign key → STORE.store_id
    • is_verified — BOOLEAN
    • verified_at — TIMESTAMP

    STORE

    • store_id — BIGINT
    • name — VARCHAR
    • address — VARCHAR
    • location — VARCHAR
    • contact — VARCHAR
    • thumbnail_url — VARCHAR
    • is_reservable — BOOLEAN
    • is_active — BOOLEAN
    • qr_token — VARCHAR
    • qr_token_issued_at — TIMESTAMP
    • created_at — TIMESTAMP

    STORE_CATEGORY

    • store_id — BIGINT — Foreign key → STORE.store_id
    • category_id — BIGINT — Foreign key → CATEGORY.category_id

    STUDENT_PROFILE

    • user_id — BIGINT — Foreign key → USER.user_id
    • college_id — BIGINT — Foreign key → COLLEGE.college_id
    • department_id — BIGINT — Foreign key → DEPARTMENT.department_id
    • student_number — VARCHAR

    USER

    • user_id — BIGINT
    • email — VARCHAR
    • password_hash — VARCHAR
    • name — VARCHAR
    • user_type — VARCHAR
    • is_email_verified — BOOLEAN
    • created_at — TIMESTAMP