質問編集履歴
1
画像の挿入
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,9 +1,56 @@
|
|
1
1
|
プログラミング初学者です。オリジナルアプリ作成時、現在はdeviseを用いたユーザー管理機能を実装中で、エラーが発生してしまいました。
|
2
2
|
|
3
3
|
# エラー文
|
4
|
-
[https://
|
4
|
+
![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-06-29/65b866ac-fa4d-491a-9b64-5162ef197b10.png)
|
5
|
+
# 試した事
|
6
|
+
```Ruby
|
7
|
+
コード
|
8
|
+
migrationファイル
|
9
|
+
```class DeviseCreateUsers < ActiveRecord::Migration[6.0]
|
10
|
+
def change
|
11
|
+
create_table :users do |t|
|
12
|
+
## Database authenticatable
|
13
|
+
t.string :email, null: false, default: ""
|
14
|
+
t.string :encrypted_password, null: false, default: ""
|
15
|
+
t.string :nickname, null: false, unique: true
|
5
16
|
|
17
|
+
## Recoverable
|
18
|
+
t.string :reset_password_token
|
19
|
+
t.datetime :reset_password_sent_at
|
20
|
+
|
21
|
+
## Rememberable
|
22
|
+
t.datetime :remember_created_at
|
23
|
+
|
24
|
+
## Trackable
|
25
|
+
# t.integer :sign_in_count, default: 0, null: false
|
26
|
+
# t.datetime :current_sign_in_at
|
27
|
+
# t.datetime :last_sign_in_at
|
28
|
+
# t.string :current_sign_in_ip
|
29
|
+
# t.string :last_sign_in_ip
|
30
|
+
|
31
|
+
## Confirmable
|
32
|
+
# t.string :confirmation_token
|
33
|
+
# t.datetime :confirmed_at
|
34
|
+
# t.datetime :confirmation_sent_at
|
35
|
+
# t.string :unconfirmed_email # Only if using reconfirmable
|
36
|
+
|
6
|
-
#
|
37
|
+
## Lockable
|
38
|
+
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
39
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
40
|
+
# t.datetime :locked_at
|
41
|
+
|
42
|
+
|
43
|
+
t.timestamps null: false
|
44
|
+
end
|
45
|
+
|
46
|
+
add_index :users, :email, unique: true
|
47
|
+
add_index :users, :reset_password_token, unique: true
|
48
|
+
# add_index :users, :confirmation_token, unique: true
|
49
|
+
# add_index :users, :unlock_token, unique: true
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
|
7
54
|
①rails db:migrate:status
|
8
55
|
実行したところdown(=マイグレート出来ていない)が表示された。
|
9
56
|
②rails db:reset
|