DEV Community

roeihaviv
roeihaviv

Posted on

Changing a column name in an existing table

To change a column name in an existing table (for example: from "body" to "movie"), we should run the following command in the terminal:
rails generate migration rename_body_column_to_movie

Then, we need to run the command:
"rails db:migrate"

Then a new migration file should appear in the "migrate" folder

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay