example-msbuild.proj 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3. <PropertyGroup>
  4. <MigratorTasksPath>$(MSBuildProjectDirectory)\..\..\build</MigratorTasksPath>
  5. </PropertyGroup>
  6. <!-- Migration-related targets, properties, etc. -->
  7. <Import Project="$(MigratorTasksPath)\Migrator.Targets" />
  8. <Target Name="Migrate">
  9. <CreateProperty Value="-1" Condition="'$(SchemaVersion)'==''">
  10. <Output TaskParameter="Value" PropertyName="SchemaVersion"/>
  11. </CreateProperty>
  12. <Migrate Provider="MySql"
  13. Connectionstring="Data Source=localhost;Database=test;User Id=root;Password=;"
  14. Migrations="$(MSBuildProjectDirectory)\migrations\migrations.dll"
  15. To="$(SchemaVersion)"/>
  16. </Target>
  17. <Target Name="Migrate-DryRun">
  18. <CreateProperty Value="-1" Condition="'$(SchemaVersion)'==''">
  19. <Output TaskParameter="Value" PropertyName="SchemaVersion"/>
  20. </CreateProperty>
  21. <Migrate Provider="MySql"
  22. Connectionstring="Data Source=localhost;Database=test;User Id=root;Password=;"
  23. Migrations="$(MSBuildProjectDirectory)\migrations\migrations.dll"
  24. To="$(SchemaVersion)"
  25. DryRun="true"/>
  26. </Target>
  27. <Target Name="Migrate-Dump">
  28. <CreateProperty Value="-1" Condition="'$(SchemaVersion)'==''">
  29. <Output TaskParameter="Value" PropertyName="SchemaVersion"/>
  30. </CreateProperty>
  31. <Migrate Provider="MySql"
  32. Connectionstring="Data Source=localhost;Database=test;User Id=root;Password=;"
  33. Migrations="$(MSBuildProjectDirectory)\migrations\migrations.dll"
  34. To="$(SchemaVersion)"
  35. ScriptFile="MSBuild-migrations.sql"/>
  36. </Target>
  37. <Target Name="Migrate-DryRun2">
  38. <CreateProperty Value="-1" Condition="'$(SchemaVersion)'==''">
  39. <Output TaskParameter="Value" PropertyName="SchemaVersion"/>
  40. </CreateProperty>
  41. <Migrate Provider="MySql"
  42. Connectionstring="Data Source=localhost;Database=test;User Id=root;Password=;"
  43. Directory="$(MSBuildProjectDirectory)\migrations\"
  44. To="$(SchemaVersion)"
  45. DryRun="true"/>
  46. </Target>
  47. </Project>