test: guard unified sql comment ordering

This commit is contained in:
2026-09-04 18:54:12 +08:00
parent 77817b4c94
commit 7bfccc87fc
@@ -155,6 +155,17 @@ test('domestic event bridge SQL converges legacy tenant columns to the customer
assert.match(incremental, /bridge_outbox_customer_column = 0 AND @bridge_outbox_tenant_column = 1/)
})
test('domestic unified SQL creates the overseas hold version before queuing its comment', async () => {
const incremental = await read('deploy/sql/头程数据库统一增量-MySQL8.sql')
const addColumn = incremental.indexOf('CALL add_inbound_overseas_hold_version();')
const queueComment = incremental.indexOf("CALL queue_column_comment('baiyue_firstleg', 'fl_inbound_order', 'last_overseas_hold_version'")
assert.notEqual(addColumn, -1)
assert.notEqual(queueComment, -1)
assert.ok(addColumn < queueComment,
'existing databases must add last_overseas_hold_version before the strict comment queue reads it')
})
test('overseas unified SQL initializes the isolated Event Bridge database before services start', async () => {
const overseas = await read('deploy/sql/海外区域统一增量-MySQL8.sql')
assert.match(overseas, /CREATE DATABASE IF NOT EXISTS baiyue_event_bridge_overseas/)