プログラミング初学者です。オリジナルアプリ作成時、現在はdeviseを用いたユーザー管理機能を実装中で、エラーが発生してしまいました。
エラー文
試した事
Ruby
1コード 2migrationファイル 3```class DeviseCreateUsers < ActiveRecord::Migration[6.0] 4 def change 5 create_table :users do |t| 6 ## Database authenticatable 7 t.string :email, null: false, default: "" 8 t.string :encrypted_password, null: false, default: "" 9 t.string :nickname, null: false, unique: true 10 11 ## Recoverable 12 t.string :reset_password_token 13 t.datetime :reset_password_sent_at 14 15 ## Rememberable 16 t.datetime :remember_created_at 17 18 ## Trackable 19 # t.integer :sign_in_count, default: 0, null: false 20 # t.datetime :current_sign_in_at 21 # t.datetime :last_sign_in_at 22 # t.string :current_sign_in_ip 23 # t.string :last_sign_in_ip 24 25 ## Confirmable 26 # t.string :confirmation_token 27 # t.datetime :confirmed_at 28 # t.datetime :confirmation_sent_at 29 # t.string :unconfirmed_email # Only if using reconfirmable 30 31 ## Lockable 32 # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts 33 # t.string :unlock_token # Only if unlock strategy is :email or :both 34 # t.datetime :locked_at 35 36 37 t.timestamps null: false 38 end 39 40 add_index :users, :email, unique: true 41 add_index :users, :reset_password_token, unique: true 42 # add_index :users, :confirmation_token, unique: true 43 # add_index :users, :unlock_token, unique: true 44 end 45end 46 47 48①rails db:migrate:status 49実行したところdown(=マイグレート出来ていない)が表示された。 50②rails db:reset 51→rails sで起動しエラー文を見ても変化無し 52③rails db:migrate RAILS_ENV=development 53→rails db:migrate:statusをするとまだdownの状況。 54④rails db:version 55→Current version: 0が返ってくる。 56→マイグレーションファイルの問題が有るのか? 57 58解決策でアドバイスが有れば、お教示下さい。
あなたの回答
tips
プレビュー