1

我通过 Nuget 安装了 Fluent Migrator... 我创建了一个基本迁移

[Migration(1)]
class _001_User : Migration
{
    public override void Up() 
    {
        Create.Table("User");
    }

    public override void Down()
    {
        Delete.Table("User");
    }
}

我使用 runner 运行它并创建版本表,但不运行此迁移。我以前使用过流利的迁移器,但不知道为什么这不起作用。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.
4

1 回答 1

2

所有迁移类都应该是公开的:

[Migration(1)]
public class _001_User : Migration
{
  // ..
}
于 2013-07-23T09:30:29.567 回答