Compare commits

...
1 Commits
Author SHA1 Message Date
txix 3c0c32ec72 2026-02-10 17:42:12: merge [main:f97795bd90603310b924d685666ce64c68644e4a];
Create and publish a Docker image / build-and-push-image (push) Canceled after 0s
2026-02-10 17:42:12 +03:00
4 changed files with 24 additions and 3 deletions

No files matched your search

+1 -1
View File
@@ -1 +1 @@
3.8.0
3.8.1
+2
View File
@@ -1,3 +1,5 @@
### v3.8.1
* исправлена миграция для `config-history`
### v3.8.0
* Добавлен новый endpoint `config/schema/update_by_module_name` для обновления схемы модуля по его названию
## v3.7.0
+2 -2
View File
@@ -167,7 +167,7 @@ func main() {
AdminId: 0,
CreatedAt: xtypes.Time(history.CreatedAt),
}
err := configHistoryRepo.Insert(ctx, result)
err := configHistoryRepo.InsertV2(ctx, result)
if err != nil {
panic(errors.WithMessagef(err, "err inserting config_history: %s", history.Id))
}
@@ -194,7 +194,7 @@ func main() {
Header("Content-Type", "application/octet-stream").
RequestBody(sqliteFile).
StatusCodeToError().
Timeout(60 * time.Second).
Timeout(120 * time.Second).
DoWithoutResponse(ctx)
if err != nil {
panic(errors.WithMessage(err, "load sqlite file"))
+19
View File
@@ -44,6 +44,25 @@ func (r ConfigHistory) Delete(ctx context.Context, id string) error {
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 {
ctx = sql_metrics.OperationLabelToContext(ctx, "ConfigHistory.Insert")