简体   繁体   中英

my migrations are being saved in another project

Recently I was working on a rails project and I asked for some help from someone else. This other person messed up my Gemfile.lock and they ended up just making a copy of my project and renaming the original folder to original_project .

Everything else works fine and I've been developing and pushing to github on this new version of my project. But now anytime I run rake db:migrate , it saves the migration to the original_project folder. Even though the migration is being run from the new project folder.

Does anyone know how to fix this? Will this have any other effect on my database when I try to deploy?

Thanks!

I apologize for the confusion. The rake tasks were working just fine. I think that all the rails commands were tied to my original project folder and when the other developer tried to copy the original folder into a new one, the rails commands were still being comprehended by the original folder.

So I ended up spending some time to fix the broken Gemfile.lock issue, pulled all my updated work from github back into the original project folder and now everything works fine.

Do you mean that rake db:migrate updates the schema in the original folder?. Try rake db:reset That will drop, create and send migrations to a new database. I don't think this has anything to do with your Gemfile.lock. I don't think you'll have problems when you deploy as long as your schema is configured. The database in production starts new. Here is a good link to rake db:tasks .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM