coupon

Tables (4)

CouponRedemptions

  • coupon_redemption_id (Coupon_Redemption_pk) — UUID — Primary key — NOT NULL
  • user_id (user_fk) — UUID — Foreign key → Users.user_id — NOT NULL
  • coupon_id (coupon_fk) — UUID — Foreign key → Coupons.coupon_id — NOT NULL
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP
  • deleted_at — TIMESTAMP

CouponTopics

  • coupon_topic_id (coupon_topic_pk) — UUID — Primary key — NOT NULL
  • name — VARCHAR(40) — NOT NULL
  • description — TEXT
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP
  • deleted_at — TIMESTAMP

Coupons

  • coupon_id (coupon_pk) — UUID — Primary key — NOT NULL
  • coupon_topic_id (coupon_topic_fk) — UUID — Foreign key → CouponTopics.coupon_topic_id — NOT NULL
  • code — VARCHAR(16) — NOT NULL
  • is_redeemed — BOOLEAN
  • is_active — BOOLEAN
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP
  • deleted_at — TIMESTAMP

Users

  • user_id — UUID — Primary key — NOT NULL
  • username — VARCHAR(20) — NOT NULL
  • email — VARCHAR(50) — NOT NULL
  • password — VARCHAR(100) — NOT NULL
  • role — VARCHAR(30)
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP
  • deleted_at — TIMESTAMP