Loading CHANGELOG.md +2 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ All notable changes to this project are documented below. The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org). ## [Unreleased] ### Changed - Improve output of `nakama migrate status` command when database contains unknown migrations. ### Fixed - Fix an issue with the JS runtime multiUpdate function. Loading migrate/migrate.go +13 −2 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ const ( type statusRow struct { ID string Migrated bool Unknown bool AppliedAt time.Time } Loading Loading @@ -247,9 +248,16 @@ func (ms *migrationService) status(logger *zap.Logger) { } } unknownMigrations := make([]string, 0) for _, r := range records { rows[r.Id].Migrated = true rows[r.Id].AppliedAt = r.AppliedAt sr, ok := rows[r.Id] if !ok { // Unknown migration found in database, perhaps from a newer server version. unknownMigrations = append(unknownMigrations, r.Id) continue } sr.Migrated = true sr.AppliedAt = r.AppliedAt } for _, m := range migrations { Loading @@ -259,6 +267,9 @@ func (ms *migrationService) status(logger *zap.Logger) { logger.Info(m.Id, zap.String("applied", "")) } } for _, m := range unknownMigrations { logger.Warn(m, zap.String("applied", "unknown migration, check if database is set up for a newer server version")) } } func (ms *migrationService) parseSubcommand(args []string, logger *zap.Logger) { Loading Loading
CHANGELOG.md +2 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ All notable changes to this project are documented below. The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org). ## [Unreleased] ### Changed - Improve output of `nakama migrate status` command when database contains unknown migrations. ### Fixed - Fix an issue with the JS runtime multiUpdate function. Loading
migrate/migrate.go +13 −2 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ const ( type statusRow struct { ID string Migrated bool Unknown bool AppliedAt time.Time } Loading Loading @@ -247,9 +248,16 @@ func (ms *migrationService) status(logger *zap.Logger) { } } unknownMigrations := make([]string, 0) for _, r := range records { rows[r.Id].Migrated = true rows[r.Id].AppliedAt = r.AppliedAt sr, ok := rows[r.Id] if !ok { // Unknown migration found in database, perhaps from a newer server version. unknownMigrations = append(unknownMigrations, r.Id) continue } sr.Migrated = true sr.AppliedAt = r.AppliedAt } for _, m := range migrations { Loading @@ -259,6 +267,9 @@ func (ms *migrationService) status(logger *zap.Logger) { logger.Info(m.Id, zap.String("applied", "")) } } for _, m := range unknownMigrations { logger.Warn(m, zap.String("applied", "unknown migration, check if database is set up for a newer server version")) } } func (ms *migrationService) parseSubcommand(args []string, logger *zap.Logger) { Loading