rakedb —Error during migration

Asked 2 years ago, Updated 2 years ago, 136 views

Prerequisites/What you want to achieve

I want to resolve the error and migrate it.

Problems/Error Messages you are experiencing

I tried to rake db:migrate in Migrate membership function to create a database table, but a message similar to an image appeared and I couldn't execute it.
Enter a description of the image here

Source Codes Affected


in the message 20170714075620_add_name_and_screen_name_and_bio_to_users.rb source code is ↓

classAddNameAndScreenNameAndBioToUsers<ActiveRecord::Migration [5.1]
  def change
    add_column:users,:name,:string
    add_column:users,:screen_name,:string
    add_column:users,:bio,:string
  end
end

Tried

rakedb:reset
rakedb:create

I tried to recreate the database using .

Supplementary information (language/FW/tool version, etc.)

Rails 5.1.2
ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]

ruby-on-rails ruby sqlite

2022-09-30 21:26

1 Answers

The users table is missing, so

 railsg scaffold user-s --no-style sheets --skip-migration

There is a high probability that you have forgotten to run the , or that you have run it later.
You can use rails destroy to start over, but you are not very familiar with it, so it is recommended that you delete the generated file or start over.


2022-09-30 21:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.