Is there a way to generate a migration file or db schema file from an existing RoR model? I lost my original migration files and the db has been deleted and I don’t want to write either by hand.
Share
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.
You should have a db/schema.rb file that is created after your migrations have been run. If you don’t have this file in your repo and you don’t have a db backup then there is nothing ActiveRecord can do for you.