简体   繁体   中英

Help with rake db:create

Im about to turn in to my school library a project which was done on rails.. this project is to be stored in a cd so that the school can have a copy of all my work for future reference if anyone wants to.... I want a simple way for people to install my project.. right now, my app depends on several migrations I made throughout the development phase and also needs some data to work properly (minimally it needs a user and some categories)...

what would be the ideal way to get this done? Im thinking, is there a way that db:create can run all of the migrations and also insert some initial data? My plan is to create a simple readme.txt file where I can dictate the simple steps to get the app up and running. Please Help, any advice is appreciated.

thanks in advance.

I think what you want is seed data, which can be thrown into your seeds.rb file, and loaded with rake db:seed

Check out the rails cast: http://railscasts.com/episodes/179-seed-data

种子数据是Jamie建议的一种方法,但是它可能会更简单,只是像您想要的那样获得它,然后随同发送sqlite数据库即可。

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