2010-11-25 4 views
1

Existe-t-il un moyen de revenir à une version spécifique en utilisant Migrator.NET? J'effectue des migrations sur une base de données SQL Server 2005 à l'aide de MSBuild.Comment migrer vers une version spécifique à l'aide de Migrator.NET

"C: \ Windows \ Microsoft.NET \ Framework \ v3.5 \ MSBuild.exe" /target: updatedb /propriété: MigrationConnectionString = "ConnectionString" « D: \ Projects \ My.Migrations .csproj "

Répondre

2

J'ai trouvé ma section cible (dans My.Migrations.csproj) ayant une propriété nommée" To ".

<Target Name="UpdateDb"> 
    <CreateProperty Condition="'$(To)'==''" value="-1"> 
     <Output PropertyName="To" TaskParameter="Value"> 
     </Output> 
    </CreateProperty> 
    <Migrate Provider="SqlServer" Connectionstring="$(MigrationConnectionString)" Migrations="$(OutputPath)$(AssemblyName).dll" To="$(To)" /> 
    </Target> 

Ainsi, tout en ajoutant /p: A = 5 (où 5 est le numéro de version trouvée dans SchemaInfo) à l'MSBuild run mentionné dans la question, j'ai pu rollback mon DB. J'espère que cela aide quelqu'un.

Questions connexes