Database Class Missing for MigratorDotNet

95 Views Asked by At

According to the Migrator.net Quick Start Tutorial, I'm supposed to invoke the Database class to invoke the migration, a la Database.CreateTable(...).

Problem is, I don't have any Database class in my project path. Visual Studio can't find it. (I installed this using NuGet, and it included three references: Migrator, Migrator.Framework, and Migrator.Providers.)

What am I missing? Here's a complete class, which looks correct (virtually an exact duplicate of the starter code on their wiki):

using System;
using System.Linq;
using System.Web;
using Migrator.Framework;
using System.Data;

namespace Migrations
{
    [Migration(1)]
    public class CreateModelTables_001
    {
        public void Up() {
            Database.ExecuteNonQuery("");
        }
    }
}
1

There are 1 best solutions below

0
ashes999 On BEST ANSWER

Your migration is not extending the Migration class. Database is a member variable. Change your class definition to:

public class CreateModelTables_001 : Migration

And you should be good to go.