ai con
Tables (11)
auth_accounts
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- provider — ENUM('LOCAL', 'KAKAO') — NOT NULL
- provider_user_id — VARCHAR(100) — NOT NULL
- password_hash — VARCHAR(255)
- created_at — TIMESTAMP
- last_login_at — TIMESTAMP
credit_logs
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- credit_type — ENUM('CHAT', 'REPORT') — NOT NULL
- change_amount — INT — NOT NULL
- reason — ENUM('PURCHASE', 'USE_CHAT', 'USE_REPORT', 'REFUND', 'ADMIN') — NOT NULL
- idempotency_key — VARCHAR(100) — NOT NULL
- reference_id — VARCHAR(100)
- created_at — TIMESTAMP
identity_verifications
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT
- merchant_uid — VARCHAR(100) — NOT NULL
- provider_tx_id — VARCHAR(100) — NOT NULL
- status — ENUM('READY', 'SUCCESS', 'FAILED')
- ci_hash — VARCHAR(64)
- fail_reason — VARCHAR(255)
- created_at — TIMESTAMP
payments
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- product_id — BIGINT — Foreign key → products.id — NOT NULL
- merchant_uid — VARCHAR(100) — NOT NULL
- pg_provider — VARCHAR(20)
- pg_tid — VARCHAR(100)
- amount — DECIMAL(10,0) — NOT NULL
- status — ENUM('READY', 'PAID', 'CANCELLED', 'PARTIAL_CANCELLED', 'FAILED')
- snap_product_code — VARCHAR(50) — NOT NULL
- snap_product_name — VARCHAR(100) — NOT NULL
- refund_amount — DECIMAL(10,0)
- cancel_reason — VARCHAR(255)
- fail_reason — VARCHAR(255)
- raw_response — JSON
- created_at — TIMESTAMP
- approved_at — TIMESTAMP
- cancelled_at — TIMESTAMP
posts
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- type — ENUM('NOTICE', 'QNA') — NOT NULL
- title — VARCHAR(200) — NOT NULL
- content — TEXT — NOT NULL
- is_secret — BOOLEAN
- access_password_hash — VARCHAR(255)
- status — ENUM('WAITING', 'ANSWERED')
- admin_reply — TEXT
- replied_by — BIGINT — Foreign key → users.id
- replied_at — TIMESTAMP
- created_at — TIMESTAMP
product_benefits
- credit_type — ENUM('CHAT', 'REPORT') — Primary key — NOT NULL
- product_id — BIGINT — Foreign key → products.id — NOT NULL
- qty — INT — NOT NULL
products
- id — BIGINT — Primary key — NOT NULL
- code — VARCHAR(50) — NOT NULL
- name — VARCHAR(100) — NOT NULL
- price — DECIMAL(10,0) — NOT NULL
- is_active — BOOLEAN
- created_at — TIMESTAMP
user_credit_balances
- credit_type — ENUM('CHAT', 'REPORT') — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- balance — INT — NOT NULL
- updated_at — TIMESTAMP
user_info_data
- id — INT — Primary key — NOT NULL
- channel_id — VARCHAR(64)
- user_id — VARCHAR(64)
- user_name — VARCHAR(64)
- phone_number — VARCHAR(64)
- total_chat_count — INT
- ticket_balance — INT
- time — TIMESTAMP
- web_user_id — BIGINT — Foreign key → users.id
user_refresh_tokens
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- refresh_token_hash — VARCHAR(255) — NOT NULL
- expires_at — TIMESTAMP — NOT NULL
- user_agent — VARCHAR(255)
- ip_address — VARCHAR(45)
- created_at — TIMESTAMP
users
- id — BIGINT — Primary key — NOT NULL
- phone_number — VARCHAR(20) — Mobile Number
- ci_hash — VARCHAR(64) — HMAC-SHA256 Unique Key
- ci_enc — VARCHAR(255) — AES-256 Encrypted
- di — VARCHAR(64)
- role — ENUM('USER', 'ADMIN')
- status — ENUM('ACTIVE', 'LOCKED', 'WITHDRAWN')
- terms_service_agreed_at — TIMESTAMP
- terms_privacy_agreed_at — TIMESTAMP
- is_marketing_agreed — BOOLEAN
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
- deleted_at — TIMESTAMP