aboutsummaryrefslogtreecommitdiffstats
path: root/db/migrate/20110803223525_create_seo_meta_for_blog.rb
blob: b1c3c319d424b92b7b6d523e7243aaceefeef2da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class CreateSeoMetaForBlog < ActiveRecord::Migration

  def up
    unless ::SeoMetum.table_exists?
      create_table ::SeoMetum.table_name do |t|
        t.integer :seo_meta_id
        t.string :seo_meta_type

        t.string :browser_title
        t.string :meta_keywords
        t.text :meta_description

        t.timestamps
      end

      add_index ::SeoMetum.table_name, :id
      add_index ::SeoMetum.table_name, [:seo_meta_id, :seo_meta_type]
    end
  end

  def down
    # can't drop the table because someone else might be using it.
  end

end