Updated

db/migrate / 20150618143114_rename_action_to_background.rb

A
21 lines of codes
1 methods
10.6 complexity/method
1 churn
10.56 complexity
0 duplications
class RenameActionToBackground < ActiveRecord::Migration
  1. RenameActionToBackground has no descriptive comment
def change
  1. RenameActionToBackground#change has approx 8 statements
rename_column :petitions, :action, :background reversible do |dir| dir.up do remove_index :petitions, name: 'index_petitions_on_action' execute <<-SQL CREATE INDEX index_petitions_on_background ON petitions USING gin(to_tsvector('english', background)); SQL end dir.down do remove_index :petitions, name: 'index_petitions_on_background' execute <<-SQL CREATE INDEX index_petitions_on_action ON petitions USING gin(to_tsvector('english', action)); SQL end end end end