-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
cc_cece edited this page Apr 18, 2026
·
1 revision
Engine: InnoDB, charset:
utf8mb4.
On startup, WebShopX auto-creates and migrates tables through SchemaManager. Core domains:
- Accounts and authentication
- Wallets and ledger
- Products and orders
- Market and auctions
- Admin management and audit
- System metadata
-
web_users- Main web account table
- Key fields:
username,password_hash,auth_state,bound_uuid
-
web_sessions- Session table
- Key fields:
token,user_id,expires_at
-
bind_requests- Bind requests and bind-code records
-
web_admins- Admin permission table
- Key fields:
is_super_admin,permissions_json,template_key
-
admin_audit_logs- Admin action audit logs
-
wallets- Wallet balances (
shop_coin,game_coin)
- Wallet balances (
-
wallet_ledger- Wallet ledger records
- Unique key:
(wallet_id, biz_type, biz_id)for idempotency
-
redeem_codes- Redeem code definitions
-
redeem_usage- Per-user redeem usage counters
-
products- Official products
- Includes dynamic pricing fields, schedule windows, stock, purchase limits, etc.
-
product_user_usage- Per-user purchase-limit counters
-
orders- Official order table
- Key fields:
order_no,status,claim_token,refund_deadline
-
order_items- Product snapshots within an order
-
delivery_queue- Official order delivery queue
-
market_listings- Market listings
- Includes source mode, trade mode, dynamic pricing, auction params, supply params
-
market_bids- Bid records (including freeze/refund states)
-
market_trades- Market trade records (including fee, tax, refund fields)
-
market_item_deliveries- Market item delivery queue
-
group_buy_vouchers- Group-buy voucher status and redemption records
-
webshop_meta- Metadata such as migration flags (for example timezone migration flags)
-
web_users1:nweb_sessions -
web_users1:1wallets -
orders1:ndelivery_queue -
orders1:norder_items -
market_listings1:nmarket_bids -
market_listings1:nmarket_trades -
market_trades1:nmarket_item_deliveries(delivery per trade)
-
orders:UNIQUE (user_id, idempotency_key) -
market_trades:UNIQUE (buyer_user_id, idempotency_key) -
market_bids:UNIQUE (bidder_user_id, idempotency_key) -
wallet_ledger:UNIQUE (wallet_id, biz_type, biz_id)
These constraints ensure retried client requests do not duplicate deduction or credit.
-
orders.claim_token- Official order manual claim code (
CLM-...)
- Official order manual claim code (
-
market_trades.claim_token- Market trade manual claim code (
MCL-...)
- Market trade manual claim code (
PENDINGWAIT_CLAIMDELIVEREDREFUNDEDRECYCLED
ACTIVEPAUSEDSOLDUNLISTED
PENDINGWAIT_CLAIMDELIVEREDREFUNDED
PENDINGWAIT_CLAIMDELIVEREDCANCELLED
- Automatically runs
CREATE TABLE IF NOT EXISTSon startup. - Automatically fills new columns and indexes for legacy instances.
- Includes data-fix logic (for example status correction and default backfill).
- Product schedule timezone migration is tracked by
webshop_meta.
- Use regular backups: full backup + binlog strategy is recommended.
- On large servers, monitor growth of:
wallet_ledgeradmin_audit_logsmarket_bidsmarket_trades
- Archive historical data as needed to avoid long-term growth.
Warning
Wiki 已迁移至 https://docs.akihito.dpdns.org/category/webshopx/ ,当前 Wiki 不再更新,并将弃用。 This wiki has moved to https://docs.akihito.dpdns.org/category/webshopx/ . It is no longer updated and will be deprecated soon.
- 本 Wiki基于 WebShopX v1.1.2 编写。
- This Wiki is based on WebShopX v1.1.2.
Warning
Wiki 已迁移至 https://docs.akihito.dpdns.org/category/webshopx/ ,当前 Wiki 不再更新,并将弃用。 This wiki has moved to https://docs.akihito.dpdns.org/category/webshopx/ . It is no longer updated and will be deprecated soon.