Thank you. I'm working on several sites with Ruby on Rails and HEROKU as a production environment.

One of them is a summary of questionnaires, and after actually starting the aggregation, a column was added.

When adding a column, an input screen and a display screen were also added.

An error occurred when moving from the development environment to the production environment. (From now on, we ’ll validate it in the staging environment ...)

The cause is now that I did not take any measures, but the data entered before the change did not contain any data about the added column, so it could not be displayed and an error occurred. It was.

It is easy if you have completely added the functions and you can empty the database as in the development environment, but you can't do that in a working environment where you already have data and I want to keep the data. . Also, since I am not a beginner, I am likely to have a lot of strange designs and changes.

If i increase or decrease the number of columns or change the table like this, I wonder if one of the following is done.

①Measure all the target parts so that no error is displayed if the column is empty. If empty, a specific value is displayed.

(2) Update the entered data by adding 0, blank, or value in some way or some way.

③ Do I want to stop the service, manipulate the data, and then return?

④In the first place, the table name cannot be changed anyway.

Because I wrote it in my imagination, it may be too much to consider, but it would be helpful if you could tell me how it was actually done, including merit and demerit.

Thanks for your patience.