FluentMigrator 命令返回未找到迁移

FluentMigrator command returning No migration found

我创建了一个新的 public class M203_InsertPercent,它将根据 SQL 语句将数据插入数据库。当我运行Migrate.exe使用连接字符串和程序集FluentMigrator.Consolereturns"No migration found"。我查看版本 table 中的数据库,但我的 class 名称不在那个 table 中。有什么我想念的吗?

确保您的迁移 class 使用 Migration 属性修饰。

[Migration(203)]
public class M203_InsertPercent : Migration
{
    ...
}

确保您的迁移 class 也是 public :

https://github.com/fluentmigrator/documentation/blob/master/articles/faq.md