Class: ChangeIncludesAndJoinsToHash

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/prawn_report/install/templates/20120222150029_change_includes_and_joins_to_hash.rb

Class Method Summary collapse

Class Method Details

.downObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/generators/prawn_report/install/templates/20120222150029_change_includes_and_joins_to_hash.rb', line 11

def self.down
  create_table :ac_filter_includes do |t|
    t.integer :ac_filter_def_id, :name => 'filter_include_in_filter'
    t.string :name
  end
  create_table :ac_filter_joins do |t|
    t.integer :ac_filter_def_id, :name => 'filter_join_in_filter'
    t.string :name
  end
  remove_column :ac_filter_defs, :include_param
  remove_column :ac_filter_defs, :joins_param
end

.upObject



4
5
6
7
8
9
# File 'lib/generators/prawn_report/install/templates/20120222150029_change_includes_and_joins_to_hash.rb', line 4

def self.up
  drop_table :ac_filter_includes
  drop_table :ac_filter_joins
  add_column :ac_filter_defs, :include_param, :text
  add_column :ac_filter_defs, :joins_param, :text
end