Running Migrations

Now that you have defined what changes to make to the database, use the following command to run the migrations:

Terminal window
$ bin/rails db:migrate

This command checks for any new migrations and applies them to your database. Its output looks like this:

Terminal window
== 20250521010850 CreateProducts: migrating ===================================
-- create_table(:products)
-> 0.0030s
== 20250521010850 CreateProducts: migrated (0.0031s) ==========================
Powered by WebContainers
Files
Preparing Environment
  • Preparing Ruby runtime
  • Create development database