fix: migrate event bridge customer columns

This commit is contained in:
2026-08-25 00:02:45 +08:00
parent e94f8629d2
commit 24149c062a
2 changed files with 51 additions and 4 deletions
@@ -101,3 +101,15 @@ test('domestic Auth receives the overseas JWT signing configuration', async () =
'OVERSEAS_JWT_RSA_JWK_SET', 'OVERSEAS_JWT_CURRENT_KID', 'OVERSEAS_ACCESS_TOKEN_TTL'
]) assert.match(compose, new RegExp(`${key}: \\$\\{${key}`))
})
test('domestic event bridge SQL converges legacy tenant columns to the customer entity contract', async () => {
const baseline = await read('event-bridge-service/src/main/resources/db/event-bridge.sql')
const incremental = await read('deploy/sql/头程数据库统一增量-MySQL8.sql')
assert.equal((baseline.match(/customer_id VARCHAR\(128\) NOT NULL/g) || []).length, 2)
assert.equal((incremental.slice(0, incremental.indexOf('CREATE TABLE IF NOT EXISTS bridge_delivery_attempt'))
.match(/customer_id VARCHAR\(128\) NOT NULL/g) || []).length, 2)
assert.match(incremental, /ALTER TABLE bridge_inbox RENAME COLUMN tenant_id TO customer_id/)
assert.match(incremental, /ALTER TABLE bridge_outbox RENAME COLUMN tenant_id TO customer_id/)
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/)
})