From the course: Ruby on Rails 6 Essential Training

Using the exercise files - Ruby on Rails Tutorial

From the course: Ruby on Rails 6 Essential Training

Start my 1-month free trial

Using the exercise files

- [Instructor] This course includes exercise files. Once we start working with the database beginning in chapter five, you way want to sync up your data so that it matches what's shown in the video. I'll demonstrate. First make sure that you have a database created and a user set up to access it. After moving the exercise files to the place where you want them, go to the command line and navigate to the root of the rails project. Once you're there, you can run the command rails otl:import. The script will walk you through the steps. You can see it provides you lots of information about what it's going to do and ask you if you want to proceed because it will wipe out any database data that you already have in place. So I'm going to say yes I do want to proceed, and then it will prompt me through a series of questions. Every time, you can hit return if you want to just accept the default setting. I'm going to accept the default for all of those. The import file path is going to be inside the directory, inside db, and that's where you'll find the SQL file that it's imported. So I'll accept that as well. And then it wants my password. That's my password I used for the rails user in this case to connect to the database. Once it says Import complete, both my files and my database should be in the correct state. Importing can also be useful if you decide to experiment on your own and then want to stop and get your data back in sync with mine.

Contents