class CreateTables < ActiveRecord::Migration[4.2]
  def self.up
    create_table :users do |t|
      t.string :username, :null => false
      t.datetime :remember_created_at
      t.string :email

      # trackable
      t.integer :sign_in_count
      t.datetime :current_sign_in_at
      t.datetime :last_sign_in_at
      t.string :current_sign_in_ip
      t.string :last_sign_in_ip

      t.timestamps
    end

    add_index :users, :username, :unique => true
  end

  def self.down
    drop_table :users
  end
end
