From e5aa1dfd383efa1efaf61fdbff0c86e7966f2d75 Mon Sep 17 00:00:00 2001 From: Mikhail Chusavitin Date: Mon, 27 Jul 2026 15:45:37 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B4=D0=B5=D1=82=D0=B5=D1=80=D0=BC?= =?UTF-8?q?=D0=B8=D0=BD=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D0=B0?= =?UTF-8?q?=D1=8F=20=D1=81=D0=BE=D1=80=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D1=80=D0=B8=20=D0=BF=D0=B0=D0=B3=D0=B8=D0=BD?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B8=20ListAll=20=D0=BA=D0=BE=D0=BD=D1=84?= =?UTF-8?q?=D0=B8=D0=B3=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Order by created_at DESC без вторичного ключа мог давать нестабильный tie-break при OFFSET/LIMIT, из-за чего строки с одинаковым created_at выпадали между страницами при импорте server→local (6 конфигов не попадали в local_configurations). Co-Authored-By: Claude Sonnet 5 --- internal/repository/configuration.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/repository/configuration.go b/internal/repository/configuration.go index 7fc4454..e2a69dd 100644 --- a/internal/repository/configuration.go +++ b/internal/repository/configuration.go @@ -104,7 +104,7 @@ func (r *ConfigurationRepository) ListAll(offset, limit int) ([]models.Configura r.db.Model(&models.Configuration{}).Count(&total) err := r.db. - Order("created_at DESC"). + Order("created_at DESC, id DESC"). Offset(offset). Limit(limit). Find(&configs).Error