// update recoprd of entity in db
update recoprd of entity in db
// update recoprd of entity in db
func (r MigrationRepository) update(ctx context.Context, tx *sqlx.Tx, entity *migration.Log) error {
	_, err := tx.ExecContext(ctx, `
			UPDATE ` + migration.TableName + ` 
			SET status = $1, "name" = $2, "time" = Now() 
			WHERE id = $3
		`, entity.Status, entity.Name, entity.ID)
	if err != nil {
		return errors.Wrapf(err, "MigrationRepository: error updating entity %v", entity)
	}
	newEntity, err := r.get(ctx, tx, entity.ID)
	if err != nil {
		return errors.Wrapf(err, "MigrationRepository: error inserting entity %v", entity)
	}
	*entity = *newEntity
	return nil
}
func ( r MigrationRepository ) update ( ctx context . Context , tx * sqlx . Tx , entity * migration . Log ) error { _ , err := tx . ExecContext ( ctx , `
			UPDATE ` + migration . TableName + ` 
			SET status = $1, "name" = $2, "time" = Now() 
			WHERE id = $3
		` , entity . Status , entity . Name , entity . ID ) if err != nil { return errors . Wrapf ( err , " " , entity ) } newEntity , err := r . get ( ctx , tx , entity . ID ) if err != nil { return errors . Wrapf ( err , " " , entity ) } * entity = * newEntity return nil }
update recoprd of entity in db
update recoprd of entity in db