coupon

Tables (4)

customer

  • id — BIGINT — Primary key — NOT NULL
  • phone_number — VARCHAR(20) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

customer_store_stamp

  • id — BIGINT — Primary key — NOT NULL
  • customer_id — BIGINT — Foreign key → customer.id — NOT NULL
  • store_id — BIGINT — Foreign key → store.id — NOT NULL
  • stamp_count — INT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

stamp_transaction

  • id — BIGINT — Primary key — NOT NULL
  • customer_store_stamp_id — BIGINT — Foreign key → customer_store_stamp.id — NOT NULL
  • type — VARCHAR(20) — NOT NULL
  • amount — INT — NOT NULL
  • balance_after — INT — NOT NULL
  • created_at — DATETIME — NOT NULL

store

  • id — BIGINT — Primary key — NOT NULL
  • pin_code — VARCHAR(50) — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL