VisualStudio SQL database project sqlcmdvars TFS deployment override custom File path?

▼魔方 西西 提交于 2019-12-05 16:55:47

The best way I found to do this was add additional entries in the dbproj file to use a different schema file depending on the configuration profile:

  <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
    <Build Include="Schema Objects\Database Level Objects\Storage\Files\BlobStore.sqlfile.sql">
      <SubType>Code</SubType>
    </Build>
  </ItemGroup>
  <ItemGroup Condition=" '$(Configuration)' == 'Internal' ">
    <Build Include="Schema Objects\Database Level Objects\Storage\Files\BlobStore.sqlfile.Internal.sql">
      <SubType>Code</SubType>
    </Build>
  </ItemGroup>

The key was copy/pasting the original schema file and appending the configuration profile name in the file name. This keeps the debug variation with the original file name so that any future schema comparisons will be oblivious to the additional variations. You want to include the additional schema files in source control, but if following suite to the entries above, they won't show up in the project. I verified MSBuild handles this correctly. I'm crossing my fingers that TFS will do the same.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!