简体   繁体   中英

How to load schema and data for my rails app

How to load schema and data for my production rails app into a different machine. I would like to converge all migrations done so far into a single migration file and point the new instance to a snapshot of the prod db. How to solve

Just copy and paste the schema and do rake db:schema:load . You can also paste the schema.rb contents into a migration, but make sure to delete all other migrations. However keep in mind that there is really no reason to do so, just leave the old migrations as they are.

To import test data use this gem: https://github.com/ludicast/yaml_db .

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