The command line can be used to run migrations. All missing migrations are run by default—it uses a database table to keep track of which have been run—or the migrations can be run individually or told to stop executing at a certain version of the database schema.
- [Narrator] Now that we've written…the create users migration,…we need to run the migrations…in order for those changes to take effect…on our database.…The way that we run a migration is from the command line,…again using the rails command,…but this time with bd:migrate.…db is gonna specify one of the many…database tasks that we could use…and then migrate is the specific task…that we want to perform.…So, make sure that you are still in the root…of your rails project…and from there type…rails db:migrate…Now, this used to be called…rake db:migrate, so if you're familiar…at all with previous versions of rails,…this used to be called rake.…
It's been changed in version 5 to be…rails db:migrate, and you want to use that here.…We'll hit return.…By default, rails db:migrate is gonna be targeting…our development database.…That's where all the changes are gonna take place.…So, now the migration ran,…and it gave us some output.…And, this is the typical output that you'll see…when a migration runs.…You'll see that it tells us the time stamp…
- Creating and configuring a new Ruby on Rails project
- Generating controllers and views
- Handling server requests
- Using different types of routes
- Rendering and viewing templates
- Generating migrations and models
- Creating, updating, and deleting records
- Finding records with queries
- Understanding relationship types
- Writing controllers for CRUD
- Working with layouts and helpers
- Managing application assets
- Building forms
- Validating data
- Authenticating users
Skill Level Beginner
1. What Is Ruby on Rails?
2. Get Started
3. Controllers, Views, and Dynamic Content
4. Databases and Migrations
5. Models and ActiveRecord
7. CRUD, REST, and Resourceful Routes
8. Controllers and CRUD
9. Layouts, Partials, and View Helpers
12. Data Validation
13. Controller Features
14. User Authentication
15. Improve the Simple CMS
Next steps1m 44s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.