0

I use this command to create an avatar column in my postgresql database.

rails g migration add_avatar_to_users avatar:string
rake db:migrate

I have an image column i would like to get rid of in the same database. I don't know the command to do so. I dont need the data and that column anymore.

I tried

rails destroy migration add_image_to_users image:string
rake db:migrate

But it did not fix the problem =/

1 Answer 1

2

rails g migration remove_image_from_users

That will generate a new migration, and then inside the change method you can write:

remove_column :users, :image
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.