From the course: Ruby on Rails 5 Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Create a database - Ruby on Rails Tutorial
From the course: Ruby on Rails 5 Essential Training
Create a database
- [Josh] If we're going to use a databse with our Rails application, then of course, we need to have one created first. If you've been following along with me, then you already created your database back in chapter two when we configured our project. Let's do a quick review of the process. There are four useful SQL commands that you should learn. Show databases, which shows a list of all the databases inside my SQL. Create database, followed by the name of the database we want to create. Use, and then the name of the database we want to use. That's especially useful for switching between databases. And then, drop database, with the name of the database we want to drop or completely remove. And that removes the database and all tables associated with it. Earlier we did create database and we created two databases. Simple CMS development and simple CMS test. That created database containers, but there's no tables on those databases yet. It's a best practice not to connect to our…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Introduction to databases7m 53s
-
(Locked)
Create a database2m 27s
-
(Locked)
Migrations3m 4s
-
(Locked)
Generate migrations4m 3s
-
(Locked)
Generate models7m 58s
-
(Locked)
Run migrations8m 22s
-
(Locked)
Migration methods7m 47s
-
(Locked)
Solve migration problems5m 41s
-
(Locked)
Challenge: Migrations for the CMS4m
-
(Locked)
Solution: Migrations for the CMS4m 20s
-
-
-
-
-
-
-
-
-
-
-
-
-