0

我正在玩迁移并创建了一个简单的迁移,例如

public class Migration001 : Migration
    {
        public override void Up()
        {
            TableSchema.Table testTable = CreateTableWithKey("TestTable");
        }

        public override void Down()
        {

        }
    }

执行 sonic.exe migrate 后,我得到以下输出:

Setting ConfigPath: 'App.config'
Building configuration from c:\tmp\MigrationTest\MigrationTest\App.config
Adding connection to SQLiteProvider
Found 1 migration files
Current DB Version is 0
Migrating to 001_Init (1)
There was an error running migration (001_Init):
 SQLite error
near "IDENTITY": syntax error
Stack Trace:
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] argum
ents, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle
 typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] argume
nts, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwn
er)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisib
ilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture)
   at SubSonic.CodeRunner.RunAndExecute(ICodeLanguage lang, String sourceCode, S
tring methodName, Object[] parameters) in D:\@SubSonic\SubSonic\SubSonic.Migrati
ons\CodeRunner.cs:line 95
   at SubSonic.Migrations.Migrator.ExecuteMigrationCode(String migrationFile) in
 D:\@SubSonic\SubSonic\SubSonic.Migrations\Migrator.cs:line 177
   at SubSonic.Migrations.Migrator.Migrate() in D:\@SubSonic\SubSonic\SubSonic.M
igrations\Migrator.cs:line 141

有什么提示吗?

4

1 回答 1

0

你可能是地球上唯一一个尝试过这个的人。我认为迁移代码从未使用 sqlite 完成或测试过,正如不应与 sqlite 一起使用的 IDENTITY 关键字所证明的那样。Subsonic 高度以 sql server 为中心,因此需要进行许多更改才能使所有功能适用于其他数据库。在 github 上的 subsonic2 的其中一个分支中有一个改进的 sqlite 提供程序,但 subsonic2 (当前)是一个死项目,并且没有 github 拉取请求被兑现。

于 2010-04-17T04:36:53.837 回答