Class: RenameBlogitTables

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/templates/rename_blogit_tables.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) change


2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/templates/rename_blogit_tables.rb', line 2

def change
  if table_exists?('blog_posts')
    rename_table('blog_posts', 'blogit_posts') 
  else
    report_missing_table("blog_posts")
  end
  
  if table_exists?('blog_comments')
    rename_table('blog_comments', 'blogit_comments')
  else
    report_missing_table("blog_posts")
  end  
end