Here you'll find quick takes on an overview to what migrations are and how to manage our database in Rails. Check out lecture guides if you'd like a more cohesive walkthrough through the concepts. Check out the cookbooks if you need to look up the details of a specific command.

There are a number of confusing things to have to remember about migrations and database management. Namely, the different naming conventions for migrations, syntax for migrations (for when you need to modify the generated code), and different database terminal commands.

The best place to look to answer any and all questions about syntax and naming convention for rails migrations is the official Ruby on Rails API documentation:

[https://edgeguides.rubyonrails.org/active_record_migrations.html](https://edgeguides.rubyonrails.org/active_record_migrations.html)

https://edgeguides.rubyonrails.org/active_record_migrations.html

Here is a quick overview of the most important rails db:* commands. All commands are prefixed with rails

Resetting your database

rails db:reset will reset the structure of your database and re-seed, but notable it does not rerun migrations one by one but rather uses the existing schema file to generate the database structure. rails db:reset is the first command you should go to when you have errors or want to delete your database.