Permalink
Browse files

add user table back

  • Loading branch information...
1 parent fb4494f commit 498bf52b56b3174274bceb3d3c15bb9a0aceedd6 @geraldb geraldb committed Dec 3, 2012
Showing with 20 additions and 14 deletions.
  1. +20 −14 db/migrate/001_create_db.rb
@@ -10,8 +10,26 @@ def up
WorldDB.create
SportDB.create
- SportDB::Market::create # market quotes
- SportDB::Play::create # pools, plays, tips, etc.
+ SportDB::Market.create # market quotes
+
+ ## NB: SportDB::Play requires/assumes a table users with col key exists
+
+create_table :users do |t|
+ t.string :key, :null => false # import/export key
+ t.string :name, :null => false
+ t.string :email, :null => false
+ t.string :password_digest
+ t.boolean :admin, :null => false, :default => false
+ t.boolean :guest, :null => false, :default => false # read-only access (cannot add tips,join pools,etc.)
+ t.boolean :active, :null => false, :default => true
+ t.timestamps
+end
+
+add_index :users, :key, :unique => true
+add_index :users, :email, :unique => true # make email unique
+
+
+ SportDB::Play.create # pools, plays, tips, etc.
#####################################
## add columns / change tables
@@ -49,18 +67,6 @@ def up
end
-change_table :users do |t|
- t.string :name, :null => false
- t.string :email, :null => false
- t.string :password_digest
- t.boolean :admin, :null => false, :default => false
- t.boolean :guest, :null => false, :default => false # read-only access (cannot add tips,join pools,etc.)
- t.boolean :active, :null => false, :default => true
-end
-
-add_index :users, :email, :unique => true # make email unique
-
-
change_table :pools do |t|
t.boolean :fix, :null => false, :default => false
t.text :welcome

0 comments on commit 498bf52

Please sign in to comment.