I already generated a class by “script/generate model blah blah1:string”
How would I add a “blah2:string” to the existing model? Is there a script or do I have to manually edit the database and every file?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Create migration:
This will create migration in db/migrate ruby file with migration – you can check if it correctly added column to table. Then run:
or in production environment:
This will add column to your database and you can use it in Rails: