优化数据库迁移
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user