Skip to content

Commit

Permalink
split index removing and addition
Browse files Browse the repository at this point in the history
  • Loading branch information
annvelents committed Dec 27, 2024
1 parent d9b7757 commit 6ecaf98
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ class AddCodeUniquenessConstraintOnInvoiceCustomSections < ActiveRecord::Migrati

def change
remove_index :invoice_custom_sections, %i[organization_id code], unique: true, algorithm: :concurrently
add_index :invoice_custom_sections, %i[organization_id code], unique: true, where: 'deleted_at IS NULL', algorithm: :concurrently
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

class AddNewIndexOnCodeForInvoiceCustomSections < ActiveRecord::Migration[7.1]
disable_ddl_transaction!

def change
add_index :invoice_custom_sections, %i[organization_id code], unique: true, where: 'deleted_at IS NULL', algorithm: :concurrently
end
end
2 changes: 1 addition & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6ecaf98

Please sign in to comment.