myshop2

Tables (13)

activity_product

  • id — BIGINT — Primary key — NOT NULL
  • type — VARCHAR(10) — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • location — VARCHAR(100)
  • activity_datetime — DATETIME
  • total_quantity — INT — NOT NULL
  • remaining_quantity — INT — NOT NULL
  • source — VARCHAR(20)

allowance

  • id — BIGINT — Primary key — NOT NULL
  • child_id — BIGINT — Foreign key → users.id — NOT NULL
  • amount — BIGINT — NOT NULL
  • cycle — VARCHAR(10) — NOT NULL
  • next_payment_date — DATE — NOT NULL
  • status — VARCHAR(10)

category

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(30) — NOT NULL

consumption_report

  • id — BIGINT — Primary key — NOT NULL
  • child_id — BIGINT — Foreign key → users.id — NOT NULL
  • year_month — VARCHAR(7) — NOT NULL
  • summary_text — TEXT — NOT NULL
  • category_breakdown — TEXT
  • total_amount — BIGINT — NOT NULL
  • generated_at — DATETIME — NOT NULL
  • is_read_parent — BOOLEAN
  • is_read_child — BOOLEAN

goal

  • id — BIGINT — Primary key — NOT NULL
  • child_id — BIGINT — Foreign key → users.id — NOT NULL
  • purpose — VARCHAR(50) — NOT NULL
  • target_amount — BIGINT — NOT NULL
  • current_amount — BIGINT
  • status — VARCHAR(20)
  • created_at — DATETIME — NOT NULL
  • first_deposit_at — DATETIME
  • interest_type — VARCHAR(10)
  • interest_value — BIGINT
  • interest_set_at — DATETIME
  • completed_at — DATETIME
  • notified_at — DATETIME
  • paid_at — DATETIME

goal_deposit

  • id — BIGINT — Primary key — NOT NULL
  • goal_id — BIGINT — Foreign key → goal.id — NOT NULL
  • amount — BIGINT — NOT NULL
  • deposited_at — DATETIME — NOT NULL

ledger

  • id — BIGINT — Primary key — NOT NULL
  • wallet_id — BIGINT — Foreign key → wallet.id
  • parent_account_id — BIGINT — Foreign key → parent_account.id
  • amount — BIGINT — NOT NULL
  • direction — VARCHAR(3) — NOT NULL
  • type — VARCHAR(20) — NOT NULL
  • merchant_id — BIGINT — Foreign key → merchant.id
  • category_id — BIGINT — Foreign key → category.id
  • goal_id — BIGINT
  • status — VARCHAR(10)
  • fail_reason — VARCHAR(100)
  • balance_after — BIGINT — NOT NULL
  • created_at — DATETIME — NOT NULL

merchant

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • category_id — BIGINT — Foreign key → category.id — NOT NULL
  • is_restricted — BOOLEAN

notification

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • type — VARCHAR(30) — NOT NULL
  • message — VARCHAR(200)
  • related_type — VARCHAR(20)
  • related_id — BIGINT
  • created_at — DATETIME — NOT NULL

parent_account

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • bank_name — VARCHAR(30) — NOT NULL
  • masked_account_number — VARCHAR(30) — NOT NULL
  • balance — BIGINT — NOT NULL

reservation

  • id — BIGINT — Primary key — NOT NULL
  • child_id — BIGINT — Foreign key → users.id — NOT NULL
  • product_id — BIGINT — Foreign key → activity_product.id — NOT NULL
  • quantity — INT — NOT NULL
  • status — VARCHAR(10)
  • created_at — DATETIME — NOT NULL

users

  • id — BIGINT — Primary key — NOT NULL
  • social_id — VARCHAR(100) — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • profile_image_url — VARCHAR(300)
  • role — VARCHAR(10)
  • parent_id — BIGINT — Foreign key → users.id
  • invite_code — VARCHAR(10)
  • created_at — DATETIME — NOT NULL

wallet

  • id — BIGINT — Primary key — NOT NULL
  • child_id — BIGINT — Foreign key → users.id — NOT NULL
  • balance — BIGINT — NOT NULL
  • updated_at — DATETIME