mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-04 23:16:37 +08:00
fix(db): 重编号 Pages 部署源迁移避免版本冲突
main 已占用 202607190001(OpenResty 默认限流), 将 Pages source runtime / scanner seed 顺延为 202607190002、202607190003,并同步迁移测试期望配置数。
This commit is contained in:
@@ -19,8 +19,9 @@ import (
|
||||
)
|
||||
|
||||
// expectedMigratedSystemConfigCount 包含初始 32 项系统配置、202606220004
|
||||
// 从 of_options 迁移过来的 48 项业务配置,以及 Pages 的 2 项业务配置。
|
||||
const expectedMigratedSystemConfigCount = 82
|
||||
// 从 of_options 迁移过来的 48 项业务配置、Pages 的 2 项业务配置,
|
||||
// 以及 OpenResty 默认限流的 3 项业务配置。
|
||||
const expectedMigratedSystemConfigCount = 85
|
||||
|
||||
func TestMigrateInitializesSQLiteDatabase(t *testing.T) {
|
||||
sqliteDB, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{
|
||||
|
||||
@@ -21,8 +21,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
pagesSourcePreviousMigration = int64(202607180001)
|
||||
pagesSourceMigration = int64(202607190001)
|
||||
pagesSourcePreviousMigration = int64(202607190001)
|
||||
pagesSourceMigration = int64(202607190002)
|
||||
pagesMigrationProjectID = uint(900001)
|
||||
pagesMigrationDeploymentID = uint(900001)
|
||||
)
|
||||
|
||||
@@ -21,8 +21,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
pagesSourceScanPreviousMigration = int64(202607190001)
|
||||
pagesSourceScanMigration = int64(202607190002)
|
||||
pagesSourceScanPreviousMigration = int64(202607190002)
|
||||
pagesSourceScanMigration = int64(202607190003)
|
||||
pagesSourceScanTaskType = "of_pages_source_scan"
|
||||
)
|
||||
|
||||
@@ -114,8 +114,8 @@ func runPagesSourceScanScheduleMigration(
|
||||
|
||||
func TestPagesSourceScanScheduleMigrationsUseDatabaseGeneratedIDs(t *testing.T) {
|
||||
for _, name := range []string{
|
||||
"goose/postgres/202607190002_seed_pages_source_scan.sql",
|
||||
"goose/sqlite/202607190002_seed_pages_source_scan.sql",
|
||||
"goose/postgres/202607190003_seed_pages_source_scan.sql",
|
||||
"goose/sqlite/202607190003_seed_pages_source_scan.sql",
|
||||
} {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
content, err := migrationFS.ReadFile(name)
|
||||
@@ -126,7 +126,7 @@ func TestPagesSourceScanScheduleMigrationsUseDatabaseGeneratedIDs(t *testing.T)
|
||||
})
|
||||
}
|
||||
|
||||
postgresContent, err := migrationFS.ReadFile("goose/postgres/202607190002_seed_pages_source_scan.sql")
|
||||
postgresContent, err := migrationFS.ReadFile("goose/postgres/202607190003_seed_pages_source_scan.sql")
|
||||
require.NoError(t, err)
|
||||
compactPostgres := strings.Join(strings.Fields(strings.ToLower(string(postgresContent))), " ")
|
||||
assert.Contains(
|
||||
|
||||
Reference in New Issue
Block a user