Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: update startup log (#7113)

Tianzhou (天舟)71f09bc6178a
diff --git a/backend/bin/server/cmd/root.go b/backend/bin/server/cmd/root.go
index 7170f04ae1..8151cb833c 100644
--- a/backend/bin/server/cmd/root.go
+++ b/backend/bin/server/cmd/root.go
@@ -261,7 +261,7 @@ func start() {
if s.SchemaVersion != nil {
schemaVersion = fmt.Sprintf("(schema version %v) ", s.SchemaVersion)
}
- fmt.Printf(greetingBanner, fmt.Sprintf("Version %s %shas started on port %d", profile.Version, schemaVersion, flags.port))
+ fmt.Printf(greetingBanner, fmt.Sprintf("Version %s %shas started on port %d 🚀", profile.Version, schemaVersion, flags.port))
// Execute program.
if err := s.Run(ctx, flags.port); err != nil {
diff --git a/backend/migrator/migrator.go b/backend/migrator/migrator.go
index 08a5e34f56..aaffea2568 100644
--- a/backend/migrator/migrator.go
+++ b/backend/migrator/migrator.go
@@ -307,13 +307,10 @@ func migrate(ctx context.Context, storeInstance *store.Store, metadataDriver dbd
return err
}
- minorVersions, messages, err := getMinorMigrationVersions(names, curVer)
+ minorVersions, err := getMinorMigrationVersions(names, curVer)
if err != nil {
return err
}
- for _, message := range messages {
- log.Info(message)
- }
for _, minorVersion := range minorVersions {
log.Info(fmt.Sprintf("Starting minor version migration cycle from %s ...", minorVersion))
@@ -544,27 +541,26 @@ func getPatchVersions(minorVersion semver.Version, currentVersion semver.Version
}
// getMinorMigrationVersions gets all the prod minor versions since currentVersion (included).
-func getMinorMigrationVersions(names []string, currentVersion semver.Version) ([]semver.Version, []string, error) {
+func getMinorMigrationVersions(names []string, currentVersion semver.Version) ([]semver.Version, error) {
versions, err := getMinorVersions(names)
if err != nil {
- return nil, nil, err
+ return nil, err
}
// We should still include the version with the same minor version with currentVersion in case we have missed some patches.
currentVersion.Patch = 0
var migrateVersions []semver.Version
- var messages []string
for _, version := range versions {
// If the migration version is less than to the current version, we will skip the migration since it's already applied.
// We should still double check the current version in case there's any patch needed.
if version.LT(currentVersion) {
- messages = append(messages, fmt.Sprintf("Skip migration %s; the current schema version %s is higher.", version, currentVersion))
+ log.Debug(fmt.Sprintf("Skip migration %s; the current schema version %s is higher.", version, currentVersion))
continue
}
migrateVersions = append(migrateVersions, version)
}
- return migrateVersions, messages, nil
+ return migrateVersions, nil
}
// getMinorVersions returns the minor versions based on file names in the prod directory.
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index 529eb2b5d4..bfcdb99889 100644
--- a/backend/migrator/migrator_test.go
+++ b/backend/migrator/migrator_test.go
@@ -50,7 +50,7 @@ func TestGetMinorMigrationVersions(t *testing.T) {
}
for _, test := range tests {
- migrateVersions, _, _ := getMinorMigrationVersions(test.names, test.currentVersion)
+ migrateVersions, _ := getMinorMigrationVersions(test.names, test.currentVersion)
require.Equal(t, test.want, migrateVersions)
}
}