feat: 增加订单筛选功能,添加按金额区间筛选的数据库索引

This commit is contained in:
2025-12-18 16:50:24 +08:00
parent e268176af5
commit 5029234e47
2 changed files with 135 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
-- +goose Up
-- +goose StatementBegin
-- orders.amount_paid为“按金额区间筛选订单”提供索引租户内隔离维度
CREATE INDEX IF NOT EXISTS ix_orders_tenant_amount_paid ON orders(tenant_id, amount_paid);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP INDEX IF EXISTS ix_orders_tenant_amount_paid;
-- +goose StatementEnd