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("");
}
}
}
Your migration is not extending the
Migrationclass. Database is a member variable. Change your class definition to:And you should be good to go.