Last active
January 2, 2016 00:49
-
-
Save warmwaffles/8226206 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EnableUuid < ActiveRecord::Migration | |
def change | |
enable_extension 'uuid-ossp' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateUsers < ActiveRecord::Migration | |
def change | |
create_table :users, id: :uuid do |t| | |
t.string :name | |
t.string :email, :null => false | |
t.string :encrypted_password, :null => false | |
t.string :salt, :null => false | |
t.string :reset_password_token, :default => nil | |
t.datetime :reset_password_token_expires_at, :default => nil | |
t.datetime :reset_password_email_sent_at, :default => nil | |
t.integer :failed_logins_count, :default => 0 | |
t.datetime :lock_expires_at, :default => nil | |
t.string :unlock_token, :default => nil | |
t.timestamps | |
end | |
add_index :users, :email, unique: true | |
add_index :users, :reset_password_token | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Schema.define(version: 02) do | |
# These are extensions that must be enabled in order to support this database | |
enable_extension "plpgsql" | |
enable_extension "uuid-ossp" | |
create_table "users", id: :uuid, default: "uuid_generate_v4()", force: true do |t| | |
t.string "name" | |
t.string "email", null: false | |
t.string "crypted_password", null: false | |
t.string "salt", null: false | |
t.string "reset_password_token" | |
t.datetime "reset_password_token_expires_at" | |
t.datetime "reset_password_email_sent_at" | |
t.integer "failed_logins_count", default: 0 | |
t.datetime "lock_expires_at" | |
t.string "unlock_token" | |
t.datetime "created_at" | |
t.datetime "updated_at" | |
end | |
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree | |
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", using: :btree | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment