我通过Nuget安装了Fluent Migrator ...我创建了一个基本的迁移
[Migration(1)]
class _001_User : Migration
{
public override void Up()
{
Create.Table("User");
}
public override void Down()
{
Delete.Table("User");
}
}
我使用它运行它并创建版本表,但不运行此迁移。我之前使用过流利的迁移器,并且不知道为什么这不起作用。 Visual Studio 2012,.NET 4.5,SqlServer2012
流利的迁移者跑者的输出。
VersionMigration migrating
[+] Beginning Transaction
[+] CreateTable VersionInfo
[+] Committing Transaction
[+] VersionMigration migrated
-------------------------------------------------------------------------------
VersionUniqueMigration migrating
-------------------------------------------------------------------------------
[+] Beginning Transaction
[+] CreateIndex VersionInfo (Version)
[+] AlterTable VersionInfo
[+] CreateColumn VersionInfo AppliedOn DateTime
[+] Committing Transaction
[+] VersionUniqueMigration migrated
[+] Task completed.
答案 0 :(得分:2)
所有迁移类都应公开:
[Migration(1)]
public class _001_User : Migration
{
// ..
}