-
Create the database
bundle exec rake db:create
- The name of the database is determined in
database.yml
bundle exec
is recommended to use before a command, this will execute the command using the versions specified in the Gemfile of this project (which may be different than what is installed on your machine)
-
Create a migration file to add a table to the database
bundle exec rake db:create_migration NAME=the_name_of_your_migration
- Typical name convention: “create_articles” where
articles
is the name of the table - Table names are plural (they hold multiple records, ex. “Articles”)
- Model names are singular and lowercase (represents one record in the database table, ex. “article.rb”)