fix: 补齐客户操作权限数据库迁移

This commit is contained in:
2026-08-08 10:30:39 +08:00
parent 77aa5a845e
commit ced35f1600
2 changed files with 45 additions and 1 deletions
@@ -80,4 +80,21 @@ class CustomerProfileMigrationContractTest {
.contains("全局 `MERCHANT_OWNER` 角色模板")
.contains("测试环境只执行当前固定入口");
}
@Test
void unifiedMigrationGrantsCustomerOperationsToPlatformAdmin() throws IOException {
Path repositoryRoot = Path.of(System.getProperty("maven.multiModuleProjectDirectory", ".."));
String sql = Files.readString(
repositoryRoot.resolve("deploy/sql/头程数据库统一增量-MySQL8.sql"),
StandardCharsets.UTF_8);
int grantStart = sql.indexOf("-- 新增平台操作权限默认只授予系统管理员。");
int grantEnd = sql.indexOf("-- 已有客户运营角色继续具备", grantStart);
assertThat(grantStart).isGreaterThanOrEqualTo(0);
assertThat(grantEnd).isGreaterThan(grantStart);
assertThat(sql.substring(grantStart, grantEnd))
.contains("'platform:customer:reset-password'")
.contains("'platform:customer:delete'")
.contains("'platform:customer:impersonate'");
}
}