Sha256: d56e83446db99b54a5e1ba4df155fe0ba074a351833d237c2db516a814e3d690

Contents?: true

Size: 989 Bytes

Versions: 3

Compression:

Stored size: 989 Bytes

Contents

class CreateTables < ActiveRecord::Migration
  def change
    create_table(:users) do |t|
      ## Database authenticatable
      t.string :email,              null: false, default: ""
      t.string :encrypted_password, null: false, default: ""

      ## Recoverable
      t.string   :reset_password_token
      t.datetime :reset_password_sent_at

      ## Trackable
      t.integer  :sign_in_count, default: 0, null: false
      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 null: false
    end

    add_index :users, :email,                unique: true
    add_index :users, :reset_password_token, unique: true
  end

  create_table :authentication_tokens do |t|
    t.string :body, null: false
    t.references :user, index: true, null: false
    t.datetime :last_used_at, null: false
    t.string :ip_address
    t.string :user_agent

    t.timestamps null: false
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tiddle-0.3.0 spec/rails_app/db/migrate/20150217000000_create_tables.rb
tiddle-0.2.0 spec/rails_app/db/migrate/20150217000000_create_tables.rb
tiddle-0.1.0 spec/rails_app/db/migrate/20150217000000_create_tables.rb