Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

ritterim/fluentmigrator-generator

Open more actions menu

Repository files navigation

FluentMigrator.Generator

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

Releases

No releases published

Packages

No packages published

Contributors 6

Morty Proxy This is a proxified and sanitized view of the page, visit original site.