2015-12-07 04:43:35 +08:00
|
|
|
class CreateArticleViews < ActiveRecord::Migration
|
|
|
|
def change
|
|
|
|
create_table :article_views do |t|
|
2015-12-09 05:05:24 +08:00
|
|
|
t.integer :article_id
|
|
|
|
t.integer :user_id
|
|
|
|
t.string :ip
|
|
|
|
t.text :param_string
|
|
|
|
t.timestamps
|
2015-12-07 04:43:35 +08:00
|
|
|
end
|
2015-12-09 05:05:24 +08:00
|
|
|
add_index :article_views, [:article_id, :ip, :created_at]
|
2015-12-07 04:43:35 +08:00
|
|
|
end
|
|
|
|
end
|