From 7dcc5cbaf15bc75737cbb75f17e176299ec7668c Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 5 Oct 2023 17:11:28 +0800 Subject: [PATCH] chore: fix mysql migrator --- store/mysql/migrator.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/store/mysql/migrator.go b/store/mysql/migrator.go index 8d44a766d..6524c6214 100644 --- a/store/mysql/migrator.go +++ b/store/mysql/migrator.go @@ -52,11 +52,8 @@ func (d *Driver) nonProdMigrate(ctx context.Context) error { func (d *Driver) prodMigrate(ctx context.Context) error { currentVersion := version.GetCurrentVersion(d.profile.Mode) migrationHistoryList, err := d.FindMigrationHistoryList(ctx, &MigrationHistoryFind{}) - if err != nil { - return errors.Wrap(err, "failed to find migration history") - } // If there is no migration history, we should apply the latest schema. - if len(migrationHistoryList) == 0 { + if err != nil || len(migrationHistoryList) == 0 { buf, err := migrationFS.ReadFile("migration/prod/" + latestSchemaFileName) if err != nil { return errors.Errorf("failed to read latest schema file: %s", err)