修复角色日志迁移与插件授权测试

This commit is contained in:
xuans committed 2026-09-10 11:49:06 +08:00
1 parent 46fd3a6bff
commit c6071414df
15 files changed
+153 -76

No files matched your search

+5 -1
View File
@@ -73,7 +73,7 @@ func TestLogStoreServerDatabaseIntegration(t *testing.T) {
t.Fatal("dedicated test database is unavailable")
}
migrations := migration.DefaultMigrations()
for _, statement := range migrations[len(migrations)-1].StatementsFor(test.dialect) {
for _, statement := range migrations[len(migrations)-2].StatementsFor(test.dialect) {
if strings.HasPrefix(statement, "CREATE TABLE IF NOT EXISTS ") {
statement = strings.Replace(statement, "CREATE TABLE IF NOT EXISTS ", "CREATE TEMPORARY TABLE ", 1)
}
@@ -81,6 +81,10 @@ func TestLogStoreServerDatabaseIntegration(t *testing.T) {
t.Fatal("temporary log schema creation failed")
}
}
actorRoleDefinition := "VARCHAR(20) NULL"
if _, err := database.ExecContext(ctx, "ALTER TABLE operation_log ADD COLUMN actor_role "+actorRoleDefinition); err != nil {
t.Fatal("temporary operation log role column creation failed")
}
store, err := New(database, test.dialect)
if err != nil {
t.Fatal(err)