I need to setup my database with tables and such, but in certain cases I don’t want my seed data to be loaded. I also don’t want to delete or move my db/seeds.rb file every time I want to ignore my seed data.
Is there a way to perform the tasks of rake db:setup and ignore seed data?
Yes. Just use the following two commands:
What
rake db:setupdoes is just creating the database (db:create), loading the data fromdb/schema.rb(db:schema:load) and then inserting the seed data (db:seed). You can do these steps separatly.