diff --git a/pkg/db/postgres/db.go b/pkg/db/postgres/db.go index 8da42469..c5a925cb 100644 --- a/pkg/db/postgres/db.go +++ b/pkg/db/postgres/db.go @@ -60,7 +60,7 @@ func DBConnect(pgConnStr string, migrationsPath string) (db.DB, error) { func (pgdb *pgDB) migrateUp(path string) (*migrate.Migrate, error) { pgdb.log.Infof("Running migrations") - instance, err := migdrv.WithInstance(pgdb.conn.DB, &migdrv.Config{}) + instance, err := migdrv.WithInstance(pgdb.conn.DB, &migdrv.Config{MigrationsTable: "migrations_um"}) if err != nil { return nil, err } diff --git a/pkg/server/impl/user_changes.go b/pkg/server/impl/user_changes.go index 094840ec..645cf227 100644 --- a/pkg/server/impl/user_changes.go +++ b/pkg/server/impl/user_changes.go @@ -412,11 +412,8 @@ func (u *serverImpl) CompletelyDeleteUser(ctx context.Context, userID string) er return cherry.ErrUnableDeleteUser() } - add, rngErr := utils.SecureRandomString(6) - if rngErr != nil { - return rngErr - } - user.Login = user.Login + "-" + add + randStr, _ := utils.SecureRandomString(6) + user.Login = user.Login + "-" + randStr err = u.svc.DB.Transactional(ctx, func(ctx context.Context, tx db.DB) error { return tx.UpdateUser(ctx, user) })