class CreateLinks < ActiveRecord::Migration
  def change
    create_table :links do |t|
      t.string :title
      t.string :url
      t.string :hostname
      t.float :popularity, default: 0.0
      t.integer :comments_count, default: 0
      t.integer :points_count, default: 0
      t.string :username
      t.references :user, index: true, foreign_key: true

      t.timestamps null: false
    end
  end
end
