d
Tables (8)
Account
- id — BIGINT — Primary key — NOT NULL
- product_code — VARCHAR(50)
- account_number — VARCHAR(50) — NOT NULL
- bank_code — VARCHAR(10)
- student_union_id — BIGINT — Foreign key → StudentUnion.id — NOT NULL
- created_at — DATETIME
Deposit
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → User.id — NOT NULL
- student_union_id — BIGINT — Foreign key → StudentUnion.id — NOT NULL
- account_id — BIGINT — Foreign key → Account.id — NOT NULL
- amount — DECIMAL(15,2) — NOT NULL
- deposit_date — DATETIME — NOT NULL
- memo — TEXT
- created_at — DATETIME
Ledger
- id — BIGINT — Primary key — NOT NULL
- student_union_id — BIGINT — Foreign key → StudentUnion.id — NOT NULL
- month — VARCHAR(7) — NOT NULL
- total_income — DECIMAL(15,2)
- total_expense — DECIMAL(15,2)
- created_at — DATETIME
LedgerDetail
- id — BIGINT — Primary key — NOT NULL
- ledger_id — BIGINT — Foreign key → Ledger.id — NOT NULL
- transaction_type — ENUM('DEPOSIT', 'WITHDRAWAL') — NOT NULL
- transaction_id — VARCHAR(36) — NOT NULL
- description — VARCHAR(500)
- amount — DECIMAL(15,2) — NOT NULL
StudentUnion
- id — BIGINT — Primary key — NOT NULL
- name — VARCHAR(200) — NOT NULL
- description — TEXT
- president_id — BIGINT — Foreign key → User.id
- created_at — DATETIME
TransactionMemo
- id — BIGINT — Primary key — NOT NULL
- transaction_type — ENUM('DEPOSIT', 'WITHDRAWAL') — NOT NULL
- content — TEXT — NOT NULL
- created_at — DATETIME
- deposit_id — BIGINT — Foreign key → Deposit.id — NOT NULL
- withdrawal_id — BIGINT — Foreign key → Withdrawal.id — NOT NULL
User
- id — BIGINT — Primary key — NOT NULL
- name — VARCHAR(100) — NOT NULL
- phone_number — VARCHAR(20)
- email — VARCHAR(100)
- created_at — DATETIME
Withdrawal
- id — BIGINT — Primary key — NOT NULL
- student_union_id — BIGINT — Foreign key → StudentUnion.id — NOT NULL
- account_id — BIGINT — Foreign key → Account.id — NOT NULL
- amount — DECIMAL(15,2) — NOT NULL
- purpose — VARCHAR(500)
- receipt_url — VARCHAR(1000)
- withdrawal_date — DATETIME — NOT NULL
- memo — TEXT
- created_at — DATETIME