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.
Answer # 1
Rails has amigrationfeature, so DB changes after creation are also done from migration.
However, changing the table name has little merit for the database change (it doesn't mean that it will be able to perform new functions).
- Python list each element with the same increase and decrease and list elements to remove space
- pandas delete row delete column increase row increase column implementation
- Example of jQuery to automatically increase or decrease the number of animation effects
- How to increase and decrease PHP Boolean values
- jquery dynamically increase and decrease table row special effects
- AngularJS uses ng-class to dynamically increase or decrease the class style example
- jQuery dynamic increase and decrease line example code analysis (recommended)
- MySQL to increase or decrease the specified time interval for all times of the current data table
- i want to increase the chrome version on heroku
- unity - i want to increase or decrease the amount of particles in a script
- when django added a specific column and deployed to heroku, only the page related to the model server error 500
- [rails] when deploying heroku, column type error in production environment postgre in development environment mysql
- python - will the site speed increase by raising the heroku plan?
- numpy - i want to increase or decrease the array data while normalizing to an arbitrary amount
- successfully deployed heroku, but can't run heroku run rails db:migrate
- ruby on rails data is not saved in db? ??
- heroku - i suddenly cannot send emails with sendgrid
- github - i can no longer deploy to heroku
- deploying to heroku gives an error saying no implicit conversion of nil into string
- ruby on rails - [beginner] rails deployment and storage
- database - about error solution by rails db: migrate
- ruby - how to display the one selected by rails5 collection_select
- mysql - [rails] i want to place a gemfile in a directory other than the root directory and deploy it to heroku
- ruby - error deploying rails heroku