修复SQLite历史业务数据升级并增加独立程序回归
This commit is contained in:
1 parent
0e16d28c1b
commit
fd2810bf03
7 files changed
+762
-6
No files matched your search
@@ -4,8 +4,6 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.pcux.cn/xuans/Scert/backend/internal/config"
|
||||
)
|
||||
|
||||
func TestMigrateRejectsInvalidHistoryWithoutChangingDatabase(t *testing.T) {
|
||||
@@ -26,7 +24,7 @@ func TestMigrateRejectsInvalidHistoryWithoutChangingDatabase(t *testing.T) {
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
db, err := Open(t.Context(), config.Default(t.TempDir()).Database)
|
||||
db, err := Open(t.Context(), sqliteBusinessUpgradeConfig(t))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -73,7 +71,7 @@ func TestMigrateRejectsInvalidHistoryWithoutChangingDatabase(t *testing.T) {
|
||||
func TestSQLiteUpgradeFromEverySupportedVersion(t *testing.T) {
|
||||
for version := 0; version <= latestMigrationVersion; version++ {
|
||||
t.Run(fmt.Sprintf("version_%d", version), func(t *testing.T) {
|
||||
db, err := Open(t.Context(), config.Default(t.TempDir()).Database)
|
||||
db, err := Open(t.Context(), sqliteBusinessUpgradeConfig(t))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user