Posts

Rails 5: Rename a Column on a Database in a Migration

While working on a Rails app, we all have had to rename a column on a database using a migration. Yet, I’m always looking up how to do it, to be sure I’m not mistyping something. So here is the good way to do it in Rails 5, using rename_column. Don’t worry, you won’t loose any data in this column.

In this article, we will be covering different situations and identifying potential gotchas.

Read more