优化数据库迁移
This commit is contained in:
@@ -73,6 +73,9 @@ CREATE TABLE IF NOT EXISTS orders (
|
|||||||
UNIQUE(provider, platform, shop_id, platform_order_id)
|
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 (
|
CREATE TABLE IF NOT EXISTS order_items (
|
||||||
id BIGSERIAL PRIMARY KEY,
|
id BIGSERIAL PRIMARY KEY,
|
||||||
order_id BIGINT NOT NULL REFERENCES orders(id) ON DELETE CASCADE,
|
order_id BIGINT NOT NULL REFERENCES orders(id) ON DELETE CASCADE,
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
ALTER TABLE admin_users
|
|
||||||
ADD COLUMN IF NOT EXISTS session_version INTEGER NOT NULL DEFAULT 1;
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
DROP TABLE IF EXISTS product_match_rules;
|
|
||||||
DROP TABLE IF EXISTS sku_fulfillment_bindings;
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
CREATE INDEX IF NOT EXISTS idx_orders_platform_order_lookup
|
|
||||||
ON orders(provider, platform, platform_order_id, id DESC);
|
|
||||||
Reference in New Issue
Block a user