Class: CreateOmnomPostsOrigins

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/omnom/install/templates/db/migrate/create_omnom_posts_origins.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/generators/omnom/install/templates/db/migrate/create_omnom_posts_origins.rb', line 2

def change
  create_table :omnom_posts_origins do |t|
    t.belongs_to :post
    t.string :feed_key
    t.string :source_key
    t.string :source_id

    t.timestamps
  end

  add_index :omnom_posts_origins, :post_id
  add_index :omnom_posts_origins, :feed_key
  add_index :omnom_posts_origins, :source_id
  add_index :omnom_posts_origins, [:feed_key, :source_id]
end