修复云端实库迁移的文本主键序列处理并校正日志测试
This commit is contained in:
1 parent
58e989cbf9
commit
d4766928b6
4 files changed
+24
-5
No files matched your search
@@ -73,7 +73,17 @@ func TestLogStoreServerDatabaseIntegration(t *testing.T) {
|
||||
t.Fatal("dedicated test database is unavailable")
|
||||
}
|
||||
migrations := migration.DefaultMigrations()
|
||||
for _, statement := range migrations[len(migrations)-2].StatementsFor(test.dialect) {
|
||||
var logSchema []string
|
||||
for _, item := range migrations {
|
||||
if item.Name == "create_managed_logs" {
|
||||
logSchema = item.StatementsFor(test.dialect)
|
||||
break
|
||||
}
|
||||
}
|
||||
if len(logSchema) == 0 {
|
||||
t.Fatal("managed log schema migration is missing")
|
||||
}
|
||||
for _, statement := range logSchema {
|
||||
if strings.HasPrefix(statement, "CREATE TABLE IF NOT EXISTS ") {
|
||||
statement = strings.Replace(statement, "CREATE TABLE IF NOT EXISTS ", "CREATE TEMPORARY TABLE ", 1)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user