Skip to content

Commit 3d43426

Browse files
committed
migrations for postgres
1 parent 4cd088c commit 3d43426

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

db/migrate/20091003003201_create_users.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
class CreateUsers < ActiveRecord::Migration
22
def self.up
33
create_table :users do |t|
4-
t.string :login, :null => false # optional, you can use email instead, or both
5-
t.string :email, :null => false # optional, you can use login instead, or both
6-
t.string :crypted_password, :null => false # optional, see below
7-
t.string :password_salt, :null => false # optional, but highly recommended
8-
t.string :persistence_token, :null => false # required
9-
t.string :single_access_token, :null => false # optional, see Authlogic::Session::Params
10-
t.string :perishable_token, :null => false # optional, see Authlogic::Session::Perishability
4+
t.string :login, :null => false, :default => "" # optional, you can use email instead, or both
5+
t.string :email, :null => false, :default => "" # optional, you can use login instead, or both
6+
t.string :crypted_password, :null => false, :default => "" # optional, see below
7+
t.string :password_salt, :null => false, :default => "" # optional, but highly recommended
8+
t.string :persistence_token, :null => false, :default => "" # required
9+
t.string :single_access_token, :null => false, :default => "" # optional, see Authlogic::Session::Params
10+
t.string :perishable_token, :default => "", :null => false
1111

1212
# Magic columns, just like ActiveRecord's created_at and updated_at. These are automatically maintained by Authlogic if they are present.
1313
t.integer :login_count, :null => false, :default => 0 # optional, see Authlogic::Session::MagicColumns
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
class AddUsersPasswordResetFields < ActiveRecord::Migration
22
def self.up
3-
add_column :users, :perishable_token, :string, :default => "", :null => false
4-
add_column :users, :email, :string, :default => "", :null => false
53

64
add_index :users, :perishable_token
75
add_index :users, :email
@@ -11,7 +9,5 @@ def self.down
119
remove_index :users, :column => :email
1210
remove_index :users, :column => :perishable_token
1311

14-
remove_column :users, :email
15-
remove_column :users, :perishable_token
1612
end
1713
end

0 commit comments

Comments
 (0)