优化数据库迁移

This commit is contained in:
yml
2026-05-28 09:15:41 +08:00
parent 9c981991a0
commit 9f1844809e
4 changed files with 3 additions and 6 deletions
@@ -73,6 +73,9 @@ CREATE TABLE IF NOT EXISTS orders (
UNIQUE(provider, platform, shop_id, platform_order_id)
);
CREATE INDEX IF NOT EXISTS idx_orders_platform_order_lookup
ON orders(provider, platform, platform_order_id, id DESC);
CREATE TABLE IF NOT EXISTS order_items (
id BIGSERIAL PRIMARY KEY,
order_id BIGINT NOT NULL REFERENCES orders(id) ON DELETE CASCADE,