mrichman (owner)

Revisions

gist: 228739 Download_button fork
public
Description:
What can I do to make this more useful or less error-prone?
Public Clone URL: git://gist.github.com/228739.git
Embed All Files: show embed
20091107103100_create_users.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
class CreateUsers < ActiveRecord::Migration
  def self.up
    create_table :users do |t|
      t.timestamps
      t.string :login, :null => false
      t.string :first_name, :null => false
      t.string :last_name, :null => false
      t.string :email, :null => false
      t.string :website, :null => false
      t.string :company_name, :default => ''
      t.string :location, :default => ''
      t.string :logo_url, :default => ''
      t.datetime :born_at
      t.string :gender, :default => ''
      t.string :address1, :null => false
      t.string :address2, :default => ''
      t.string :city, :null => false
      t.string :state, :null => false
      t.string :postal_code, :null => false
      t.string :country, :null => false
      t.string :home_phone, :default => ''
      t.string :work_phone, :default => ''
      t.string :mobile_phone, :default => ''
      t.string :crypted_password, :null => false
      t.string :password_salt, :null => false
      t.string :persistence_token, :null => false
      t.integer :login_count, :default => 0, :null => false
      t.datetime :last_request_at
      t.datetime :last_login_at
      t.datetime :current_login_at
      t.string :last_login_ip
      t.string :current_login_ip
    end
    
    add_index :users, :login
    add_index :users, :persistence_token
    add_index :users, :last_request_at
  end
 
  def self.down
    drop_table :users
  end
end