Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Treehouse

Entity Framework Migrations Course (How To)

via Treehouse

Overview

In this course, you'll learn how to use Entity Framework Code First Migrations to propagate data model changes to your database.

What you'll learn

  • Enabling Migrations
  • Adding Migrations
  • Updating the Database
  • Modifying Migrations
  • Deploying Migrations

Syllabus

Getting Started with Using Migrations

We'll start by looking at the challenge of maintaining our data model after our application has been released into production and how Code First Migrations helps us with propagating data model changes to the database. Then we'll see how to enable migrations for our project, create our first migration, and update our database. We'll also see how the Migration Fluent API is used within migration classes and how to seed our database using the migrations Configuration class.

Chevron 12 steps
  • What are Migrations?

    4:41

  • Enabling Migrations

    6:06

  • Code First Migrations Review

    5 questions

  • The Configuration Class

    2:09

  • Adding Our First Migration

    4:05

  • The Migration Fluent API

    6:04

  • Updating the Database

    4:13

  • Populating Our Database with Seed Data

    7:31

  • Using the Configuration Class to Add Seed Data

    1 objective

  • Excluding Test Data in Production

    5:54

  • Using a Preprocessor Directive to Exclude Test Data

    1 objective

  • Section Review

    10 questions

Digging Deeper Into Migrations

Now that we have a basic understanding of what migrations are and how they work, let's make a change to our data model and add a migration for that change. We'll also see how we can not only upgrade our database, but also downgrade it. And we'll look at an example of a data model change that'll require us to modify the migration that EF generates for us. Then we'll wrap up with an overview of workflows and environments and the various deployment options that Code First Migrations provides.

Chevron 6 steps
  • Making a Model Change

    7:43

  • Downgrading the Database

    5:01

  • Modifying Migration Classes

    12:47

  • Workflows and Environments

    4:02

  • Deployment Options

    8:26

  • Section Review

    10 questions

Reviews

Start your review of Entity Framework Migrations Course (How To)

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.