Class: WPB::AddTypeToWpPosts

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/wpb.rb

Class Method Summary collapse

Class Method Details

.downObject



26
27
28
# File 'lib/wpb.rb', line 26

def self.down
  remove_column :wp_posts, :type
end

.upObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/wpb.rb', line 15

def self.up
  suppress_messages do
    unless column_exists? :wp_posts, :type
      add_column :wp_posts, :type, :string
      PagePost.reset_column_information
    else
      puts "\tWordPress Database Already Initialized"
    end
  end
end