From 5750cbe640f5fcb3fd33c6d06ba97a458c81945f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B0=D1=80=D0=B0=D1=81=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=94=D0=B5=D0=BD=D0=B8=D1=81=20=D0=90=D0=BD=D0=B0=D1=82=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D0=B5=D0=B2=D0=B8=D1=87?= Date: Fri, 13 Sep 2024 13:41:49 +0000 Subject: [PATCH] [DEX-2325] feat: add index --- CHANGELOG.md | 6 ++++++ README.md | 2 +- lib/generators/helpers/migration.rb | 2 +- lib/sbmt/outbox/version.rb | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83899ba..5a2c219 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +## [6.9.0] - 2024-09-13 + +### Added + +- Replaced index `add_index :#{table_name}, [:status, :bucket, :errors_count]` to `add_index :#{table_name}, [:status, :id, :bucket], algorithm: :concurrently, include: [:errors_count]` + ## [6.8.0] - 2024-09-05 ### Added diff --git a/README.md b/README.md index 32310ee..ee9c729 100644 --- a/README.md +++ b/README.md @@ -235,7 +235,7 @@ create_table :my_outbox_items do |t| end add_index :my_outbox_items, :uuid, unique: true -add_index :my_outbox_items, [:status, :bucket, :errors_count] +add_index :my_outbox_items, [:status, :id, :bucket], algorithm: :concurrently, include: [:errors_count] add_index :my_outbox_items, [:event_name, :event_key, :id] add_index :my_outbox_items, :created_at ``` diff --git a/lib/generators/helpers/migration.rb b/lib/generators/helpers/migration.rb index 06bdeae..f5b956b 100644 --- a/lib/generators/helpers/migration.rb +++ b/lib/generators/helpers/migration.rb @@ -44,7 +44,7 @@ def patch_migration_with_template_data(migration_filepath, table_name) end add_index :#{table_name}, :uuid, unique: true - add_index :#{table_name}, [:status, :bucket, :errors_count] + add_index :#{table_name}, [:status, :id, :bucket], algorithm: :concurrently, include: [:errors_count] add_index :#{table_name}, [:event_key, :id] add_index :#{table_name}, :created_at RUBY diff --git a/lib/sbmt/outbox/version.rb b/lib/sbmt/outbox/version.rb index 0b3438c..2fd744f 100644 --- a/lib/sbmt/outbox/version.rb +++ b/lib/sbmt/outbox/version.rb @@ -2,6 +2,6 @@ module Sbmt module Outbox - VERSION = "6.8.0" + VERSION = "6.9.0" end end