Class: CortexReaver::UserSchema

Inherits:
Sequel::Migration
  • Object
show all
Defined in:
lib/cortex_reaver/migrations/001_users.rb

Instance Method Summary collapse

Instance Method Details

#downObject



3
4
5
# File 'lib/cortex_reaver/migrations/001_users.rb', line 3

def down
  drop_table :users if table_exists? :users
end

#upObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/cortex_reaver/migrations/001_users.rb', line 7

def up
  unless table_exists? :users
    create_table :users do
      primary_key :id
      varchar :login, :index => true, :unique => true, :null => false
      varchar :name
      varchar :http
      varchar :email
      varchar :password
      varchar :salt
      boolean :admin, :default => false
      datetime :created_on, :null => false 
      datetime :updated_on, :null => false
    end
  end
end