2015-12-07 04:43:35 +08:00
|
|
|
class CreateArticleStars < ActiveRecord::Migration
|
|
|
|
def change
|
|
|
|
create_table :article_stars do |t|
|
2015-12-09 05:05:24 +08:00
|
|
|
t.integer :article_id
|
|
|
|
t.integer :user_id
|
|
|
|
t.timestamps
|
2015-12-07 04:43:35 +08:00
|
|
|
end
|
2015-12-09 05:05:24 +08:00
|
|
|
add_index :article_stars, [:article_id, :user_id]
|
2015-12-07 04:43:35 +08:00
|
|
|
end
|
|
|
|
end
|