Create seed file from data already in the database

后端 未结 4 504
再見小時候
再見小時候 2020-12-07 20:06

I\'m using Rails 3.0.3 and have data for my \"categories\" table already in the database, but want to create a seed file from it. Is there any rake task that will generate t

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 20:58

    I've used YamlDb to dump data from my development db and then load it up to another server. It dumps the data to a Yaml file, which will be used any time you want to use db:load to push it up to any other db server.

    https://github.com/ludicast/yaml_db

提交回复
热议问题