Skip to content

Commit

Permalink
Fix merit_actions migration template (#357)
Browse files Browse the repository at this point in the history
if `add_index` is outside of the `def self.change` method, it's executed
right away, and:

    Caused by:
    ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "merit_actions" does not exist
  • Loading branch information
pirj authored May 25, 2021
1 parent b002ab9 commit bd48a4d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CreateMeritActions < ActiveRecord::Migration<%= migration_version %>
t.boolean :processed, default: false
t.timestamps null: false
end
end

add_index :merit_actions, :processed
add_index :merit_actions, :processed
end
end

0 comments on commit bd48a4d

Please sign in to comment.