2010-04-12 8 views
0

Je Migrations joue avec et créé une Migrations migration simple commeException avec Subsonic 2.2, SQLite et

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

     public override void Down() 
     { 

     } 
    } 

après l'exécution sonic.exe migrate Je reçois la sortie suivante:

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 

Des indices?

Répondre

0

Vous êtes probablement le seul sur la planète Terre à l'avoir essayé. Je ne pense pas que le code de migration ait jamais été complété ou testé avec sqlite, comme en témoigne le mot clé IDENTITY qui ne devrait pas être utilisé avec sqlite. Subsonic est très centré sur le serveur sql, donc il y a beaucoup de changements nécessaires pour que toutes les fonctionnalités fonctionnent pour d'autres bases de données. Il y a un fournisseur sqlite amélioré dans une des fourches de subsonic2 sur github, mais subsonic2 est (actuellement) un projet mort et aucune demande de pull github n'est honorée.