Skip to content

Commit

Permalink
fix(migrations): Split add_column and index (#2277)
Browse files Browse the repository at this point in the history
breakdown `payment_overdue` invoice
  • Loading branch information
julienbourdeau authored Jul 11, 2024
1 parent bf196d2 commit e891c8c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 0 additions & 3 deletions db/migrate/20240611074215_add_payment_overdue_to_invoices.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# frozen_string_literal: true

class AddPaymentOverdueToInvoices < ActiveRecord::Migration[7.0]
disable_ddl_transaction!

def change
add_column :invoices, :payment_overdue, :boolean, default: false
add_index :invoices, :payment_overdue, algorithm: :concurrently

reversible do |dir|
dir.up do
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

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

def change
add_index :invoices, :payment_overdue, algorithm: :concurrently, if_not_exists: true
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 e891c8c

Please sign in to comment.