Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c0c32ec72 |
No files matched your search
@@ -1,3 +1,5 @@
|
|||||||
|
### v3.8.1
|
||||||
|
* исправлена миграция для `config-history`
|
||||||
### v3.8.0
|
### v3.8.0
|
||||||
* Добавлен новый endpoint `config/schema/update_by_module_name` для обновления схемы модуля по его названию
|
* Добавлен новый endpoint `config/schema/update_by_module_name` для обновления схемы модуля по его названию
|
||||||
## v3.7.0
|
## v3.7.0
|
||||||
|
|||||||
+2
-2
@@ -167,7 +167,7 @@ func main() {
|
|||||||
AdminId: 0,
|
AdminId: 0,
|
||||||
CreatedAt: xtypes.Time(history.CreatedAt),
|
CreatedAt: xtypes.Time(history.CreatedAt),
|
||||||
}
|
}
|
||||||
err := configHistoryRepo.Insert(ctx, result)
|
err := configHistoryRepo.InsertV2(ctx, result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(errors.WithMessagef(err, "err inserting config_history: %s", history.Id))
|
panic(errors.WithMessagef(err, "err inserting config_history: %s", history.Id))
|
||||||
}
|
}
|
||||||
@@ -194,7 +194,7 @@ func main() {
|
|||||||
Header("Content-Type", "application/octet-stream").
|
Header("Content-Type", "application/octet-stream").
|
||||||
RequestBody(sqliteFile).
|
RequestBody(sqliteFile).
|
||||||
StatusCodeToError().
|
StatusCodeToError().
|
||||||
Timeout(60 * time.Second).
|
Timeout(120 * time.Second).
|
||||||
DoWithoutResponse(ctx)
|
DoWithoutResponse(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(errors.WithMessage(err, "load sqlite file"))
|
panic(errors.WithMessage(err, "load sqlite file"))
|
||||||
|
|||||||
@@ -44,6 +44,25 @@ func (r ConfigHistory) Delete(ctx context.Context, id string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r ConfigHistory) InsertV2(ctx context.Context, history entity.ConfigHistory) error {
|
||||||
|
ctx = sql_metrics.OperationLabelToContext(ctx, "ConfigHistory.InsertV2")
|
||||||
|
|
||||||
|
query, args, err := squirrel.Insert(Table("config_history")).
|
||||||
|
Columns("id", "config_id", "data", "version", "admin_id").
|
||||||
|
Values(history.Id, history.ConfigId, history.Data, history.Version, history.AdminId).
|
||||||
|
ToSql()
|
||||||
|
if err != nil {
|
||||||
|
return errors.WithMessage(err, "build query")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = r.db.Exec(ctx, query, args...)
|
||||||
|
if err != nil {
|
||||||
|
return errors.WithMessagef(err, "exec: %s", query)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (r ConfigHistory) Insert(ctx context.Context, history entity.ConfigHistory) error {
|
func (r ConfigHistory) Insert(ctx context.Context, history entity.ConfigHistory) error {
|
||||||
ctx = sql_metrics.OperationLabelToContext(ctx, "ConfigHistory.Insert")
|
ctx = sql_metrics.OperationLabelToContext(ctx, "ConfigHistory.Insert")
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user