O'Reilly logo

Learning Sinatra by Manoj Sehrawat, Sudeep Agarwal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to run migrations

Now we have defined all our migrations. To change the schema of our database, we need to execute all of them. We have already installed the sequel gem and we have five migration files in the db/migrations folder.

So, for sequel to create the tables, we need to create a database first. In the command prompt, we type the following command:

mysql -u root -p

This will open the MySQL shell by entering the password for the root user. You can also use mysql -u user -p if you want to use a different user for the application:

mysql> create database todo;

This will create a database named todo. Now we need to execute the migration files to populate the tables.

Now, close the MySQL console and run the following command on the console ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required