Class: Sinatra::SimpleAuthentication::Models::ActiveRecord::CreateUsers

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/sinatra/simple_authentication/models/active_record/user.rb

Class Method Summary collapse

Class Method Details

.downObject



24
25
26
27
# File 'lib/sinatra/simple_authentication/models/active_record/user.rb', line 24

def self.down
  remove_index :ar_users, :email
  drop_table :ar_users
end

.upObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/sinatra/simple_authentication/models/active_record/user.rb', line 13

def self.up
  create_table :ar_users do |t|
    t.string :email
    t.string :hashed_password
    t.string :salt
    #t.timestamps
  end

  add_index :ar_users, :email, :unique => true
end