- Added a new entry for user interaction habit analysis based on agent transcripts, summarizing key insights into communication styles and preferences. - Updated project indices to reflect the latest developments, including the addition of a wallet balance feature and enhancements to the mini program's user interface for better user experience. - Improved the handling of loading states in the chapters page, ensuring a smoother user experience during data retrieval. - Implemented a gift payment sharing feature, allowing users to share payment requests with friends for collaborative purchases.
26 lines
1.1 KiB
SQL
26 lines
1.1 KiB
SQL
-- 代付请求表 + 订单表代付字段
|
||
-- 执行:mysql -u user -p db < soul-api/scripts/add-gift-pay-requests.sql
|
||
-- 注:orders 表新增字段由 GORM AutoMigrate 自动添加;若需手动执行:
|
||
-- ALTER TABLE orders ADD COLUMN gift_pay_request_id VARCHAR(50) DEFAULT NULL;
|
||
-- ALTER TABLE orders ADD COLUMN payer_user_id VARCHAR(50) DEFAULT NULL;
|
||
|
||
CREATE TABLE IF NOT EXISTS gift_pay_requests (
|
||
id VARCHAR(50) PRIMARY KEY,
|
||
request_sn VARCHAR(32) NOT NULL UNIQUE,
|
||
initiator_user_id VARCHAR(50) NOT NULL,
|
||
product_type VARCHAR(30) NOT NULL,
|
||
product_id VARCHAR(50) NOT NULL DEFAULT '',
|
||
amount DECIMAL(10,2) NOT NULL,
|
||
description VARCHAR(200) NOT NULL DEFAULT '',
|
||
status VARCHAR(20) NOT NULL DEFAULT 'pending',
|
||
payer_user_id VARCHAR(50) DEFAULT NULL,
|
||
order_id VARCHAR(50) DEFAULT NULL,
|
||
expire_at DATETIME NOT NULL,
|
||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||
INDEX idx_initiator (initiator_user_id),
|
||
INDEX idx_payer (payer_user_id),
|
||
INDEX idx_status (status),
|
||
INDEX idx_request_sn (request_sn)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|