fix(event-bridge): restore overseas event delivery
This commit is contained in:
@@ -131,3 +131,21 @@ test('domestic event bridge SQL converges legacy tenant columns to the customer
|
||||
assert.match(incremental, /bridge_inbox_customer_column = 0 AND @bridge_inbox_tenant_column = 1/)
|
||||
assert.match(incremental, /bridge_outbox_customer_column = 0 AND @bridge_outbox_tenant_column = 1/)
|
||||
})
|
||||
|
||||
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/)
|
||||
assert.match(overseas, /USE baiyue_event_bridge_overseas;/)
|
||||
for (const table of ['bridge_outbox', 'bridge_inbox', 'bridge_delivery_attempt']) {
|
||||
assert.match(overseas, new RegExp(`CREATE TABLE IF NOT EXISTS ${table}`))
|
||||
}
|
||||
for (const index of [
|
||||
'uk_bridge_outbox_idempotency', 'idx_bridge_outbox_schedule',
|
||||
'uk_bridge_inbox_idempotency', 'idx_bridge_inbox_consume',
|
||||
'uk_bridge_attempt', 'idx_bridge_attempt_event'
|
||||
]) assert.match(overseas, new RegExp(index))
|
||||
assert.match(overseas, /COUNT\(DISTINCT CONCAT\(table_name, ':', index_name\)\)/)
|
||||
assert.match(overseas, /CALL assert_overseas_event_bridge_schema\(\);/)
|
||||
assert.ok(overseas.indexOf('USE baiyue_event_bridge_overseas;') < overseas.indexOf('USE baiyue_lastleg;'),
|
||||
'overseas Event Bridge schema must be initialized before Lastleg tables')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user