chore(db): 寄卖合并迁移顺延为 159,避开 main 的 152/158 编号
This commit is contained in:
@@ -12,7 +12,7 @@ const ISSUE_REPO = new URL(
|
||||
import.meta.url,
|
||||
)
|
||||
const FULFILLMENT = new URL('./consignment-fulfillment-service.ts', import.meta.url)
|
||||
const MIGRATION = new URL('../../db/migrations/152_consignment_platform.sql', import.meta.url)
|
||||
const MIGRATION = new URL('../../db/migrations/159_consignment_platform.sql', import.meta.url)
|
||||
|
||||
test('手动匹配不再在事务外改状态:数量不足/并发占库失败不能留下无截止时间的 internal_matching', async () => {
|
||||
const source = await readFile(ENGINE, 'utf8')
|
||||
|
||||
@@ -149,9 +149,9 @@ test('降价提示:未售出时长支持一位小数,按小数小时判断',
|
||||
assert.equal(suggestion?.suggestedPriceFen, 9_000)
|
||||
})
|
||||
|
||||
test('合并迁移 152 必须包含寄卖配置、库存数量/售价与分配表', async () => {
|
||||
test('合并迁移 159 必须包含寄卖配置、库存数量/售价与分配表', async () => {
|
||||
const source = await readFile(
|
||||
new URL('../../db/migrations/152_consignment_platform.sql', import.meta.url),
|
||||
new URL('../../db/migrations/159_consignment_platform.sql', import.meta.url),
|
||||
'utf8',
|
||||
)
|
||||
for (const fragment of [
|
||||
@@ -163,7 +163,7 @@ test('合并迁移 152 必须包含寄卖配置、库存数量/售价与分配
|
||||
'internal_match_deadline_at',
|
||||
'consignment_inventory_id',
|
||||
]) {
|
||||
assert.ok(source.includes(fragment), `合并迁移 152 缺少 ${fragment}`)
|
||||
assert.ok(source.includes(fragment), `合并迁移 159 缺少 ${fragment}`)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -214,9 +214,9 @@ test('寄售数量上限按分类统计,并在打手配置接口返回 activeQ
|
||||
assert.ok(source.includes('GROUP BY profile_id'), '各分类数量必须一次分组取回')
|
||||
})
|
||||
|
||||
test('合并迁移 152 的苏尔南种子:降价提示默认开启、24 小时、按比例 10%', async () => {
|
||||
test('合并迁移 159 的苏尔南种子:降价提示默认开启、24 小时、按比例 10%', async () => {
|
||||
const sql = await readFile(
|
||||
new URL('../../db/migrations/152_consignment_platform.sql', import.meta.url),
|
||||
new URL('../../db/migrations/159_consignment_platform.sql', import.meta.url),
|
||||
'utf8',
|
||||
)
|
||||
assert.match(
|
||||
|
||||
@@ -36,7 +36,7 @@ function option(label: string, value: string) {
|
||||
return { label, value, enabled: true }
|
||||
}
|
||||
|
||||
/** 苏尔南手枪种子配置的五个字段(与合并迁移 152 一致)。 */
|
||||
/** 苏尔南手枪种子配置的五个字段(与合并迁移 159 一致)。 */
|
||||
function surnanSpecs(): ConsignmentSpecField[] {
|
||||
return [
|
||||
{
|
||||
@@ -522,9 +522,9 @@ test('动态规格:旧列仍由兼容 key 同步', () => {
|
||||
})
|
||||
})
|
||||
|
||||
test('合并迁移 152 必须包含动态规格的 JSON、匹配 key、文本与改价上限', async () => {
|
||||
test('合并迁移 159 必须包含动态规格的 JSON、匹配 key、文本与改价上限', async () => {
|
||||
const sql = await readFile(
|
||||
new URL('../../db/migrations/152_consignment_platform.sql', import.meta.url),
|
||||
new URL('../../db/migrations/159_consignment_platform.sql', import.meta.url),
|
||||
'utf8',
|
||||
)
|
||||
for (const fragment of [
|
||||
@@ -534,7 +534,7 @@ test('合并迁移 152 必须包含动态规格的 JSON、匹配 key、文本与
|
||||
'price_cap_fen',
|
||||
'CREATE INDEX IF NOT EXISTS idx_consignment_inventories_spec_key',
|
||||
]) {
|
||||
assert.ok(sql.includes(fragment), `合并迁移 152 缺少 ${fragment}`)
|
||||
assert.ok(sql.includes(fragment), `合并迁移 159 缺少 ${fragment}`)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -549,9 +549,9 @@ test('发布数量:关闭「允许修改寄售数量」时固定为 1,开启
|
||||
assert.equal(resolveConsignmentPublishQuantity(true, 1.6), 2, '四舍五入')
|
||||
})
|
||||
|
||||
test('合并迁移 152 必须为苏尔南手枪写入已发布的五个单选字段配置', async () => {
|
||||
test('合并迁移 159 必须为苏尔南手枪写入已发布的五个单选字段配置', async () => {
|
||||
const sql = await readFile(
|
||||
new URL('../../db/migrations/152_consignment_platform.sql', import.meta.url),
|
||||
new URL('../../db/migrations/159_consignment_platform.sql', import.meta.url),
|
||||
'utf8',
|
||||
)
|
||||
for (const fragment of [
|
||||
@@ -561,6 +561,6 @@ test('合并迁移 152 必须为苏尔南手枪写入已发布的五个单选字
|
||||
"'published'",
|
||||
'"key": "brillianceCount"',
|
||||
]) {
|
||||
assert.ok(sql.includes(fragment), `合并迁移 152 缺少 ${fragment}`)
|
||||
assert.ok(sql.includes(fragment), `合并迁移 159 缺少 ${fragment}`)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user