Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Laner12/6d615c8d05c61fb6245b408cc08e8627 to your computer and use it in GitHub Desktop.
Save Laner12/6d615c8d05c61fb6245b408cc08e8627 to your computer and use it in GitHub Desktop.
What is a primary key?
* The id of a resource in this table.
What is a foreign key?
* The primary key from another table used as a link to find data.
Why would one row of data have both primary and foreign keys?
* If it was a join table or if the table had a one to many relationship.
What is Rails' convention for the column name of the primary key?
* id
What is Rails' convention for the column name of a foreign key?
* singular-table-name_id
What are dev, test, and prod databases all about?
* They are seperate enviroments. One for testing , another for development, and a final for the production code.
What is the database.yml and how is it used?
* It shows all of the enviroments that were created (test, development, production)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment