docs(GOV-005): 建立 MySQL 5.7 兼容性基线
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import test from 'node:test';
|
||||
|
||||
const architecturePath = new URL('../../docs/architecture/system-architecture.md', import.meta.url);
|
||||
const standardsPath = new URL('../../docs/governance/code-development-standards.md', import.meta.url);
|
||||
|
||||
test('系统架构固定 MySQL 5.7 字符集与排序规则', async () => {
|
||||
const architecture = await readFile(architecturePath, 'utf8');
|
||||
|
||||
assert.match(architecture, /MySQL 5\.7/);
|
||||
assert.match(architecture, /utf8mb4/);
|
||||
assert.match(architecture, /utf8mb4_general_ci/);
|
||||
});
|
||||
|
||||
test('开发规范覆盖 MySQL 5.7 全链路兼容性要求', async () => {
|
||||
const standards = await readFile(standardsPath, 'utf8');
|
||||
|
||||
for (const requiredText of [
|
||||
'MySQL 5.7',
|
||||
'utf8mb4',
|
||||
'utf8mb4_general_ci',
|
||||
'公用表表达式',
|
||||
'窗口函数',
|
||||
'函数索引',
|
||||
'utf8mb4_0900_',
|
||||
'不区分大小写',
|
||||
'索引长度',
|
||||
'迁移脚本',
|
||||
'代码 Review',
|
||||
]) {
|
||||
assert.ok(standards.includes(requiredText), `开发规范缺少数据库基线:${requiredText}`);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user