class CreateBookmarks < ActiveRecord::Migration
  def change
    create_table :bookmarks do |t|
      t.timestamps
      t.string :title,                  null: false, default: ''
      t.string :url,                    null: false
      t.text :description
      t.integer :access_count,          null: false, default: 0
    end

    add_index :bookmarks, :access_count
  end

  def self.down
    drop_table :bookmarks
  end
end
