【初期データの設定】
db/seed.rb で、モデルの初期データ設定を記述(create)
csvからの読み込みも可能
(参考)
http://www.rubylife.jp/rails/model/index10.html
【初期データの投入】
【DB作成&初期データ投入】
・DB作成&初期データ投入(migration実行ではなく、schema.rbから復帰)
(Create the database, load the schema, and initialize with the seed data)
rake db:setup
・DB再作成&初期データ投入(migration実行ではなく、schema.rbから復帰)
(Drops and recreates the database from db/schema.rb
for the current environment and loads the seeds)
rake db:reset
・schema.rbでなく、migration から再作成したいときは
rake db:migrate:reset
(参考)
rakeのタスク一覧
http://pentan.info/ruby/ror/rake_list.html#rake_db