Files
Ydisks-Xianyu-Helper/internal/db/migrations/sqlite/00034_ai_bargain_auto_price.sql
T
Christ 50eca2fca6 修复:完善上传契约与自动化闭环
统一 multipart 请求透传并补齐接口契约和边界校验;新增 AI 自动改价、暂时性失败重试、擦亮与确认发货幂等处理;修复聊天已读回执跨端同步误报警,并更新前端静态资源与回归测试。
2026-08-20 19:03:29 +08:00

29 lines
997 B
SQL

-- +goose Up
ALTER TABLE ai_reply_settings
ADD COLUMN auto_adjust_price_enabled BOOLEAN NOT NULL DEFAULT FALSE;
CREATE TABLE ai_bargain_quotes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
cookie_id TEXT NOT NULL,
chat_id TEXT NOT NULL,
buyer_id TEXT NOT NULL,
item_id TEXT NOT NULL,
price_cents INTEGER NOT NULL,
status TEXT NOT NULL DEFAULT 'pending',
order_id TEXT,
expires_at INTEGER NOT NULL,
error_message TEXT NOT NULL DEFAULT '',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (cookie_id) REFERENCES cookies(id) ON DELETE CASCADE,
UNIQUE (cookie_id, order_id)
);
CREATE INDEX idx_ai_bargain_quotes_pending
ON ai_bargain_quotes(cookie_id, buyer_id, item_id, chat_id, status, expires_at, id);
-- +goose Down
DROP INDEX IF EXISTS idx_ai_bargain_quotes_pending;
DROP TABLE IF EXISTS ai_bargain_quotes;
ALTER TABLE ai_reply_settings DROP COLUMN auto_adjust_price_enabled;