How to drop columns using Rails migration

0 votes
What's the syntax for dropping a database table column through a Rails migration?
Jul 24, 2020 in Java-Script by kartik
• 37,510 points
823 views

1 answer to this question.

0 votes

Hello @kartik,

Use this:

remove_column :table_name, :column_name

For instance:

remove_column :users, :hobby

Hope it helps!!

Thank You!!

answered Jul 24, 2020 by Niroj
• 82,880 points

Related Questions In Java-Script

0 votes
1 answer

How to Abort Ajax requests using jQuery?

Hello kartik, Just use ajax.abort(). For example you could ...READ MORE

answered Apr 27, 2020 in Java-Script by Niroj
• 82,880 points
8,760 views
+1 vote
2 answers

How to convert entire div data into image and save it into directory without using canvas?

Hello @kartik, You can try the sample code ...READ MORE

answered Apr 29, 2020 in Java-Script by Niroj
• 82,880 points
70,486 views
0 votes
1 answer

How to select and manipulate CSS pseudo-elements such as ::before and ::after using jQuery?

Hii @kartik, Here is the way to access ...READ MORE

answered May 18, 2020 in Java-Script by Niroj
• 82,880 points
6,083 views
0 votes
3 answers
0 votes
1 answer

How to rollback a specific migration?

Hello @kartik, Try this: rake db:migrate:down VERSION=20100905201547 will roll back ...READ MORE

answered Jul 24, 2020 in Java-Script by Niroj
• 82,880 points
2,724 views
0 votes
1 answer

How to check if a specific key is present in a hash or not?

Hello @kartik, While Hash#has_key? gets the job done, as it has ...READ MORE

answered Jul 24, 2020 in Java-Script by Niroj
• 82,880 points
3,039 views
0 votes
1 answer

How to “pretty” format JSON output in Ruby on Rails?

Hello @kartik, Use the pretty_generate() function, built into later versions ...READ MORE

answered Jul 24, 2020 in Java-Script by Niroj
• 82,880 points
10,493 views
0 votes
1 answer

How can I specify a local gem in my Gemfile?

Hello @kartik, In order to use local gem ...READ MORE

answered Jul 24, 2020 in Java-Script by Niroj
• 82,880 points
3,341 views
+1 vote
1 answer

How can we send message multiple time to a specific person or group in whatsapp using loop?

Hii @kartik,  This is simple task to send single ...READ MORE

answered Feb 28, 2020 in Java-Script by Niroj
• 82,880 points
17,502 views
0 votes
1 answer

How to Scroll to the top of the page using JavaScript?

Hii @kartik, Using javascript <script> $("a[href='#top']").click(function() { ...READ MORE

answered Apr 2, 2020 in Java-Script by Niroj
• 82,880 points
777 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP