diff options
| author | mo khan <mo@mokhan.ca> | 2015-02-21 12:36:27 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-02-21 12:36:27 -0700 |
| commit | df3daf73da872a6872582fa925ffae29f6fdca6b (patch) | |
| tree | 402b52221f35d7176b996c31ebc5956bb3d39da8 /db/migrate | |
| parent | 6ada62adfd2b60e3af4f721ed8e09a5658920fa6 (diff) | |
fix users table schema.
Diffstat (limited to 'db/migrate')
| -rw-r--r-- | db/migrate/20150221192553_create_users.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/db/migrate/20150221192553_create_users.rb b/db/migrate/20150221192553_create_users.rb index 72a9f38..f1a7146 100644 --- a/db/migrate/20150221192553_create_users.rb +++ b/db/migrate/20150221192553_create_users.rb @@ -1,10 +1,12 @@ class CreateUsers < ActiveRecord::Migration def change - create_table :users do |t| - t.string :username - t.string :password_digest + create_table :users, id: :uuid, default: 'uuid_generate_v4()' do |t| + t.string :username, null: false + t.string :password_digest, null: false t.timestamps null: false end + + add_index :users, :username, unique: true end end |
