Skip to content

A simple PowerShell script to generate database migrations from the package manager console in Visual Studio.

License

Notifications You must be signed in to change notification settings

brendangooden/fluentmigrator-generator-core

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FluentMigratorGenerator.DotNetCore

Important: Uninstall previous versions of FluentMigrator.Generator before installing this one.

FluentMigrator is a SQL migration framework designed to help version an application's database. This package allows a developer to quickly create a new migration from within Visual Studio's Package Manager console.

A few notable features:

  • Timestamp generation
  • Migration file named correctly with timestamp
  • Migration added to Migrations folder under current active project

It couldn't be easier!

Getting Started

PM > Install-Package FluentMigrator.Generator

Once installed, open the Package Manager Console in Visual Studio. To get there, go to View > Other Windows > Package Manager Console. Remember to select the active project via the Default Project dropdown.

In the new window, type Add-FluentMigration followed by the name of your migration.

Add-FluentMigration InitialMigration

You should see the following structure in the Default Project project.

ConsoleApplication1
|- /Migrations
    |- 20160219141436_InitialMigration.cs

The migration file contents should look like the following.

using FluentMigrator;

namespace ConsoleApplication1.Migrations
{
    [Migration(20160219141436)]
    public class InitialMigration : Migration
    {
        public override void Up()
        {
        }

        public override void Down()
        {
        }
    }
}

Fill in the migration appropriately.

About

A simple PowerShell script to generate database migrations from the package manager console in Visual Studio.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PowerShell 100.0%