about summary refs log tree commit diff stats
path: root/db
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-06-25 12:30:31 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-06-25 12:30:31 -0400
commit7e2e42379cb40a500eb8a236c05788eb3e84d141 (patch)
tree784dfe04f81b034889b96b5c251923da7e6f3a1e /db
parent275218aeaf24d4f9d58589cf68ec6647f0a65050 (diff)
downloadthoughts-7e2e42379cb40a500eb8a236c05788eb3e84d141.tar.gz
thoughts-7e2e42379cb40a500eb8a236c05788eb3e84d141.tar.bz2
thoughts-7e2e42379cb40a500eb8a236c05788eb3e84d141.zip
Added logging in and logging out
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170625151955_devise_create_users.rb44
-rw-r--r--db/schema.rb21
2 files changed, 64 insertions, 1 deletions
diff --git a/db/migrate/20170625151955_devise_create_users.rb b/db/migrate/20170625151955_devise_create_users.rb new file mode 100644 index 0000000..799f225 --- /dev/null +++ b/db/migrate/20170625151955_devise_create_users.rb
@@ -0,0 +1,44 @@
1class DeviseCreateUsers < ActiveRecord::Migration[5.1]
2 def change
3 create_table :users do |t|
4 ## Database authenticatable
5 t.string :login, null: false, default: ""
6 t.string :email, null: false, default: ""
7 t.string :encrypted_password, null: false, default: ""
8
9 ## Recoverable
10 t.string :reset_password_token
11 t.datetime :reset_password_sent_at
12
13 ## Rememberable
14 t.datetime :remember_created_at
15
16 ## Trackable
17 t.integer :sign_in_count, default: 0, null: false
18 t.datetime :current_sign_in_at
19 t.datetime :last_sign_in_at
20 t.string :current_sign_in_ip
21 t.string :last_sign_in_ip
22
23 ## Confirmable
24 # t.string :confirmation_token
25 # t.datetime :confirmed_at
26 # t.datetime :confirmation_sent_at
27 # t.string :unconfirmed_email # Only if using reconfirmable
28
29 ## Lockable
30 # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
31 # t.string :unlock_token # Only if unlock strategy is :email or :both
32 # t.datetime :locked_at
33
34
35 t.timestamps null: false
36 end
37
38 add_index :users, :login, unique: true
39 add_index :users, :email, unique: true
40 add_index :users, :reset_password_token, unique: true
41 # add_index :users, :confirmation_token, unique: true
42 # add_index :users, :unlock_token, unique: true
43 end
44end
diff --git a/db/schema.rb b/db/schema.rb index 6eca6ad..b690393 100644 --- a/db/schema.rb +++ b/db/schema.rb
@@ -10,7 +10,7 @@
10# 10#
11# It's strongly recommended that you check this file into your version control system. 11# It's strongly recommended that you check this file into your version control system.
12 12
13ActiveRecord::Schema.define(version: 20170625004938) do 13ActiveRecord::Schema.define(version: 20170625151955) do
14 14
15 create_table "entries", force: :cascade do |t| 15 create_table "entries", force: :cascade do |t|
16 t.string "title" 16 t.string "title"
@@ -31,4 +31,23 @@ ActiveRecord::Schema.define(version: 20170625004938) do
31 t.index ["recordable_type", "recordable_id"], name: "index_records_on_recordable_type_and_recordable_id" 31 t.index ["recordable_type", "recordable_id"], name: "index_records_on_recordable_type_and_recordable_id"
32 end 32 end
33 33
34 create_table "users", force: :cascade do |t|
35 t.string "login", default: "", null: false
36 t.string "email", default: "", null: false
37 t.string "encrypted_password", default: "", null: false
38 t.string "reset_password_token"
39 t.datetime "reset_password_sent_at"
40 t.datetime "remember_created_at"
41 t.integer "sign_in_count", default: 0, null: false
42 t.datetime "current_sign_in_at"
43 t.datetime "last_sign_in_at"
44 t.string "current_sign_in_ip"
45 t.string "last_sign_in_ip"
46 t.datetime "created_at", null: false
47 t.datetime "updated_at", null: false
48 t.index ["email"], name: "index_users_on_email", unique: true
49 t.index ["login"], name: "index_users_on_login", unique: true
50 t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
51 end
52
34end 53end