mini

Tables (3)

accounts

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • balance — BIGINT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

transactions

  • id — BIGINT — Primary key — NOT NULL
  • account_id — BIGINT — Foreign key → accounts.id — NOT NULL
  • type — VARCHAR(20) — NOT NULL
  • amount — BIGINT — NOT NULL
  • balance_after — BIGINT — NOT NULL
  • merchant_id — VARCHAR(50)
  • idempotency_key — VARCHAR(100)
  • status — VARCHAR(20) — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

users

  • id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • password_hash — VARCHAR(255) — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • pin_hash — VARCHAR(255) — NOT NULL
  • created_at — DATETIME(6) — NOT NULL