diff --git a/application/migrator/share.go b/application/migrator/share.go index 8e5900d3..8fba330e 100644 --- a/application/migrator/share.go +++ b/application/migrator/share.go @@ -36,7 +36,6 @@ func (m *Migrator) migrateShare() error { tx, err := m.v4client.Tx(ctx) if err != nil { - _ = tx.Rollback() return fmt.Errorf("failed to start transaction: %w", err) } diff --git a/inventory/file.go b/inventory/file.go index a698f3c9..5f1abfde 100644 --- a/inventory/file.go +++ b/inventory/file.go @@ -417,7 +417,7 @@ func (f *fileClient) CreateDirectLink(ctx context.Context, file int, name string func (f *fileClient) GetByHashID(ctx context.Context, hashID string) (*ent.File, error) { id, err := f.hasher.Decode(hashID, hashid.FileID) if err != nil { - return nil, fmt.Errorf("ailed to decode hash id %q: %w", hashID, err) + return nil, fmt.Errorf("failed to decode hash id %q: %w", hashID, err) } return withFileEagerLoading(ctx, f.client.File.Query().Where(file.ID(id))).First(ctx) diff --git a/inventory/migration.go b/inventory/migration.go index 2734b3c1..a03c254c 100644 --- a/inventory/migration.go +++ b/inventory/migration.go @@ -826,7 +826,7 @@ func applyPatches(l logging.Logger, client *ent.Client, ctx context.Context, req return fmt.Errorf("failed to parse required version %s: %w", requiredDbVersion, err) } - if latestAppliedVersion == nil || requiredVersion.Compare(requiredVersion) > 0 { + if latestAppliedVersion == nil || requiredVersion.Compare(latestAppliedVersion) > 0 { latestAppliedVersion = requiredVersion }