mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Standardize slashes in sqlproj (#11174)
* standardize slashes that go in sqlproj * update tests to not have os specific baselines * fix test * fix delete tests * some cleanup
This commit is contained in:
@@ -100,6 +100,14 @@ export function getPlatformSafeFileEntryPath(filePath: string): string {
|
|||||||
return parts.join('/');
|
return parts.join('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Standardizes slashes to be "\\" for consistency between platforms and compatibility with SSDT
|
||||||
|
*/
|
||||||
|
export function convertSlashesForSqlProj(filePath: string): string {
|
||||||
|
const parts = filePath.split('/');
|
||||||
|
return parts.join('\\');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read SQLCMD variables from xmlDoc and return them
|
* Read SQLCMD variables from xmlDoc and return them
|
||||||
* @param xmlDoc xml doc to read SQLCMD variables from. Format must be the same that sqlproj and publish profiles use
|
* @param xmlDoc xml doc to read SQLCMD variables from. Format must be the same that sqlproj and publish profiles use
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ export class Project {
|
|||||||
|
|
||||||
private addFileToProjFile(path: string) {
|
private addFileToProjFile(path: string) {
|
||||||
const newFileNode = this.projFileXmlDoc.createElement(constants.Build);
|
const newFileNode = this.projFileXmlDoc.createElement(constants.Build);
|
||||||
newFileNode.setAttribute(constants.Include, path);
|
newFileNode.setAttribute(constants.Include, utils.convertSlashesForSqlProj(path));
|
||||||
|
|
||||||
this.findOrCreateItemGroup(constants.Build).appendChild(newFileNode);
|
this.findOrCreateItemGroup(constants.Build).appendChild(newFileNode);
|
||||||
}
|
}
|
||||||
@@ -320,7 +320,7 @@ export class Project {
|
|||||||
const fileNodes = this.projFileXmlDoc.documentElement.getElementsByTagName(constants.Build);
|
const fileNodes = this.projFileXmlDoc.documentElement.getElementsByTagName(constants.Build);
|
||||||
|
|
||||||
for (let i = 0; i < fileNodes.length; i++) {
|
for (let i = 0; i < fileNodes.length; i++) {
|
||||||
if (fileNodes[i].getAttribute(constants.Include) === path) {
|
if (fileNodes[i].getAttribute(constants.Include) === utils.convertSlashesForSqlProj(path)) {
|
||||||
fileNodes[i].parentNode.removeChild(fileNodes[i]);
|
fileNodes[i].parentNode.removeChild(fileNodes[i]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -331,7 +331,7 @@ export class Project {
|
|||||||
|
|
||||||
private addFolderToProjFile(path: string) {
|
private addFolderToProjFile(path: string) {
|
||||||
const newFolderNode = this.projFileXmlDoc.createElement(constants.Folder);
|
const newFolderNode = this.projFileXmlDoc.createElement(constants.Folder);
|
||||||
newFolderNode.setAttribute(constants.Include, path);
|
newFolderNode.setAttribute(constants.Include, utils.convertSlashesForSqlProj(path));
|
||||||
|
|
||||||
this.findOrCreateItemGroup(constants.Folder).appendChild(newFolderNode);
|
this.findOrCreateItemGroup(constants.Folder).appendChild(newFolderNode);
|
||||||
}
|
}
|
||||||
@@ -340,7 +340,7 @@ export class Project {
|
|||||||
const folderNodes = this.projFileXmlDoc.documentElement.getElementsByTagName(constants.Folder);
|
const folderNodes = this.projFileXmlDoc.documentElement.getElementsByTagName(constants.Folder);
|
||||||
|
|
||||||
for (let i = 0; i < folderNodes.length; i++) {
|
for (let i = 0; i < folderNodes.length; i++) {
|
||||||
if (folderNodes[i].getAttribute(constants.Include) === path) {
|
if (folderNodes[i].getAttribute(constants.Include) === utils.convertSlashesForSqlProj(path)) {
|
||||||
folderNodes[i].parentNode.removeChild(folderNodes[i]);
|
folderNodes[i].parentNode.removeChild(folderNodes[i]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -363,7 +363,7 @@ export class Project {
|
|||||||
referenceNode.setAttribute(constants.Condition, constants.NetCoreCondition);
|
referenceNode.setAttribute(constants.Condition, constants.NetCoreCondition);
|
||||||
}
|
}
|
||||||
|
|
||||||
referenceNode.setAttribute(constants.Include, isSystemDatabaseProjectEntry ? entry.fsUri.fsPath.substring(1) : entry.fsUri.fsPath); // need to remove the leading slash for system database path for build to work on Windows
|
referenceNode.setAttribute(constants.Include, entry.pathForSqlProj());
|
||||||
this.addDatabaseReferenceChildren(referenceNode, entry.name);
|
this.addDatabaseReferenceChildren(referenceNode, entry.name);
|
||||||
this.findOrCreateItemGroup(constants.ArtifactReference).appendChild(referenceNode);
|
this.findOrCreateItemGroup(constants.ArtifactReference).appendChild(referenceNode);
|
||||||
this.databaseReferences.push(entry);
|
this.databaseReferences.push(entry);
|
||||||
@@ -372,7 +372,7 @@ export class Project {
|
|||||||
if (isSystemDatabaseProjectEntry) {
|
if (isSystemDatabaseProjectEntry) {
|
||||||
let ssdtReferenceNode = this.projFileXmlDoc.createElement(constants.ArtifactReference);
|
let ssdtReferenceNode = this.projFileXmlDoc.createElement(constants.ArtifactReference);
|
||||||
ssdtReferenceNode.setAttribute(constants.Condition, constants.NotNetCoreCondition);
|
ssdtReferenceNode.setAttribute(constants.Condition, constants.NotNetCoreCondition);
|
||||||
ssdtReferenceNode.setAttribute(constants.Include, (<SystemDatabaseReferenceProjectEntry>entry).ssdtUri.fsPath.substring(1)); // need to remove the leading slash for system database path for build to work on Windows
|
ssdtReferenceNode.setAttribute(constants.Include, (<SystemDatabaseReferenceProjectEntry>entry).ssdtPathForSqlProj());
|
||||||
this.addDatabaseReferenceChildren(ssdtReferenceNode, entry.name);
|
this.addDatabaseReferenceChildren(ssdtReferenceNode, entry.name);
|
||||||
this.findOrCreateItemGroup(constants.ArtifactReference).appendChild(ssdtReferenceNode);
|
this.findOrCreateItemGroup(constants.ArtifactReference).appendChild(ssdtReferenceNode);
|
||||||
}
|
}
|
||||||
@@ -548,6 +548,10 @@ export class ProjectEntry {
|
|||||||
public toString(): string {
|
public toString(): string {
|
||||||
return this.fsUri.path;
|
return this.fsUri.path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public pathForSqlProj(): string {
|
||||||
|
return utils.convertSlashesForSqlProj(this.fsUri.path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -567,6 +571,16 @@ class SystemDatabaseReferenceProjectEntry extends DatabaseReferenceProjectEntry
|
|||||||
constructor(uri: Uri, public ssdtUri: Uri, public name: string) {
|
constructor(uri: Uri, public ssdtUri: Uri, public name: string) {
|
||||||
super(uri, DatabaseReferenceLocation.differentDatabaseSameServer, name);
|
super(uri, DatabaseReferenceLocation.differentDatabaseSameServer, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public pathForSqlProj(): string {
|
||||||
|
// need to remove the leading slash for system database path for build to work on Windows
|
||||||
|
return utils.convertSlashesForSqlProj(this.fsUri.path.substring(1));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ssdtPathForSqlProj(): string {
|
||||||
|
// need to remove the leading slash for system database path for build to work on Windows
|
||||||
|
return utils.convertSlashesForSqlProj(this.ssdtUri.path.substring(1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum EntryType {
|
export enum EntryType {
|
||||||
|
|||||||
@@ -77,11 +77,11 @@
|
|||||||
<Delete Files="$(BaseIntermediateOutputPath)\project.assets.json"/>
|
<Delete Files="$(BaseIntermediateOutputPath)\project.assets.json"/>
|
||||||
</Target>
|
</Target>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)/SystemDacpacs/130/master.dacpac">
|
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)\SystemDacpacs\130\master.dacpac">
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
||||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
||||||
</ArtifactReference>
|
</ArtifactReference>
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' != 'true'" Include="$(DacPacRootPath)/Extensions/Microsoft/SQLDB/Extensions/SqlServer/130/SqlSchemas/master.dacpac">
|
<ArtifactReference Condition="'$(NetCoreBuild)' != 'true'" Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac">
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
||||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
||||||
</ArtifactReference>
|
</ArtifactReference>
|
||||||
|
|||||||
@@ -1,89 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<Name>TestProjectName</Name>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectVersion>4.1</ProjectVersion>
|
|
||||||
<ProjectGuid>{BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575}</ProjectGuid>
|
|
||||||
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider</DSP>
|
|
||||||
<OutputType>Database</OutputType>
|
|
||||||
<RootPath>
|
|
||||||
</RootPath>
|
|
||||||
<RootNamespace>TestProjectName</RootNamespace>
|
|
||||||
<AssemblyName>TestProjectName</AssemblyName>
|
|
||||||
<ModelCollation>1033, CI</ModelCollation>
|
|
||||||
<DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
|
|
||||||
<DeployToDatabase>True</DeployToDatabase>
|
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
|
||||||
<TargetLanguage>CS</TargetLanguage>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<SqlServerVerification>False</SqlServerVerification>
|
|
||||||
<IncludeCompositeObjects>True</IncludeCompositeObjects>
|
|
||||||
<TargetDatabaseSet>True</TargetDatabaseSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
|
|
||||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<DefineDebug>false</DefineDebug>
|
|
||||||
<DefineTrace>true</DefineTrace>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
|
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<DefineDebug>true</DefineDebug>
|
|
||||||
<DefineTrace>true</DefineTrace>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
|
|
||||||
<!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
|
|
||||||
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
|
|
||||||
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Condition="'$(NetCoreBuild)' != 'true' AND '$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets"/>
|
|
||||||
<Import Condition="'$(NetCoreBuild)' != 'true' AND '$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets"/>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Properties"/>
|
|
||||||
<Folder Include="Tables"/>
|
|
||||||
<Folder Include="Views"/>
|
|
||||||
<Folder Include="Views\Maintenance"/>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Build Include="Tables\Users.sql"/>
|
|
||||||
<Build Include="Tables\Action History.sql"/>
|
|
||||||
<Build Include="Views\Maintenance\Database Performance.sql"/>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Views\User"/>
|
|
||||||
<Build Include="Views\User\Profile.sql"/>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Condition="'$(NetCoreBuild)' == 'true'" Project="$(NETCoreTargetsPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets"/>
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Condition="'$(NetCoreBuild)' == 'true'" Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All"/>
|
|
||||||
</ItemGroup>
|
|
||||||
<Target Name="AfterClean">
|
|
||||||
<Delete Files="$(BaseIntermediateOutputPath)\project.assets.json"/>
|
|
||||||
</Target>
|
|
||||||
<ItemGroup>
|
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)\SystemDacpacs\130\master.dacpac">
|
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
|
||||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
|
||||||
</ArtifactReference>
|
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' != 'true'" Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac">
|
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
|
||||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
|
||||||
</ArtifactReference>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -77,19 +77,19 @@
|
|||||||
<Delete Files="$(BaseIntermediateOutputPath)\project.assets.json"/>
|
<Delete Files="$(BaseIntermediateOutputPath)\project.assets.json"/>
|
||||||
</Target>
|
</Target>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)/SystemDacpacs/130/master.dacpac">
|
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)\SystemDacpacs\130\master.dacpac">
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
||||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
||||||
</ArtifactReference>
|
</ArtifactReference>
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' != 'true'" Include="$(DacPacRootPath)/Extensions/Microsoft/SQLDB/Extensions/SqlServer/130/SqlSchemas/master.dacpac">
|
<ArtifactReference Condition="'$(NetCoreBuild)' != 'true'" Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac">
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
||||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
||||||
</ArtifactReference>
|
</ArtifactReference>
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)/SystemDacpacs/130/msdb.dacpac">
|
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)\SystemDacpacs\130\msdb.dacpac">
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
||||||
<DatabaseVariableLiteralValue>msdb</DatabaseVariableLiteralValue>
|
<DatabaseVariableLiteralValue>msdb</DatabaseVariableLiteralValue>
|
||||||
</ArtifactReference>
|
</ArtifactReference>
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' != 'true'" Include="$(DacPacRootPath)/Extensions/Microsoft/SQLDB/Extensions/SqlServer/130/SqlSchemas/msdb.dacpac">
|
<ArtifactReference Condition="'$(NetCoreBuild)' != 'true'" Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\msdb.dacpac">
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
||||||
<DatabaseVariableLiteralValue>msdb</DatabaseVariableLiteralValue>
|
<DatabaseVariableLiteralValue>msdb</DatabaseVariableLiteralValue>
|
||||||
</ArtifactReference>
|
</ArtifactReference>
|
||||||
|
|||||||
@@ -1,97 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<Name>TestProjectName</Name>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectVersion>4.1</ProjectVersion>
|
|
||||||
<ProjectGuid>{BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575}</ProjectGuid>
|
|
||||||
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider</DSP>
|
|
||||||
<OutputType>Database</OutputType>
|
|
||||||
<RootPath>
|
|
||||||
</RootPath>
|
|
||||||
<RootNamespace>TestProjectName</RootNamespace>
|
|
||||||
<AssemblyName>TestProjectName</AssemblyName>
|
|
||||||
<ModelCollation>1033, CI</ModelCollation>
|
|
||||||
<DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
|
|
||||||
<DeployToDatabase>True</DeployToDatabase>
|
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
|
||||||
<TargetLanguage>CS</TargetLanguage>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<SqlServerVerification>False</SqlServerVerification>
|
|
||||||
<IncludeCompositeObjects>True</IncludeCompositeObjects>
|
|
||||||
<TargetDatabaseSet>True</TargetDatabaseSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
|
|
||||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<DefineDebug>false</DefineDebug>
|
|
||||||
<DefineTrace>true</DefineTrace>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
|
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<DefineDebug>true</DefineDebug>
|
|
||||||
<DefineTrace>true</DefineTrace>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
|
|
||||||
<!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
|
|
||||||
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
|
|
||||||
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Condition="'$(NetCoreBuild)' != 'true' AND '$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets"/>
|
|
||||||
<Import Condition="'$(NetCoreBuild)' != 'true' AND '$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets"/>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Properties"/>
|
|
||||||
<Folder Include="Tables"/>
|
|
||||||
<Folder Include="Views"/>
|
|
||||||
<Folder Include="Views\Maintenance"/>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Build Include="Tables\Users.sql"/>
|
|
||||||
<Build Include="Tables\Action History.sql"/>
|
|
||||||
<Build Include="Views\Maintenance\Database Performance.sql"/>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Views\User"/>
|
|
||||||
<Build Include="Views\User\Profile.sql"/>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Condition="'$(NetCoreBuild)' == 'true'" Project="$(NETCoreTargetsPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets"/>
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Condition="'$(NetCoreBuild)' == 'true'" Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All"/>
|
|
||||||
</ItemGroup>
|
|
||||||
<Target Name="AfterClean">
|
|
||||||
<Delete Files="$(BaseIntermediateOutputPath)\project.assets.json"/>
|
|
||||||
</Target>
|
|
||||||
<ItemGroup>
|
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)\SystemDacpacs\130\master.dacpac">
|
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
|
||||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
|
||||||
</ArtifactReference>
|
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' != 'true'" Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac">
|
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
|
||||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
|
||||||
</ArtifactReference>
|
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)\SystemDacpacs\130\msdb.dacpac">
|
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
|
||||||
<DatabaseVariableLiteralValue>msdb</DatabaseVariableLiteralValue>
|
|
||||||
</ArtifactReference>
|
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' != 'true'" Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\msdb.dacpac">
|
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
|
||||||
<DatabaseVariableLiteralValue>msdb</DatabaseVariableLiteralValue>
|
|
||||||
</ArtifactReference>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -77,11 +77,7 @@
|
|||||||
<Delete Files="$(BaseIntermediateOutputPath)\project.assets.json"/>
|
<Delete Files="$(BaseIntermediateOutputPath)\project.assets.json"/>
|
||||||
</Target>
|
</Target>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)/SystemDacpacs/130/master.dacpac">
|
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)\SystemDacpacs\130\master.dacpac">
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
|
||||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
|
||||||
</ArtifactReference>
|
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' != 'true'" Include="$(DacPacRootPath)/Extensions/Microsoft/SQLDB/Extensions/SqlServer/130/SqlSchemas/master.dacpac">
|
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
||||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
||||||
</ArtifactReference>
|
</ArtifactReference>
|
||||||
@@ -90,5 +86,9 @@
|
|||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
||||||
<DatabaseVariableLiteralValue>msdb</DatabaseVariableLiteralValue>
|
<DatabaseVariableLiteralValue>msdb</DatabaseVariableLiteralValue>
|
||||||
</ArtifactReference>
|
</ArtifactReference>
|
||||||
|
<ArtifactReference Condition="'$(NetCoreBuild)' != 'true'" Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac">
|
||||||
|
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
||||||
|
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
||||||
|
</ArtifactReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,94 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<Name>TestProjectName</Name>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectVersion>4.1</ProjectVersion>
|
|
||||||
<ProjectGuid>{BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575}</ProjectGuid>
|
|
||||||
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider</DSP>
|
|
||||||
<OutputType>Database</OutputType>
|
|
||||||
<RootPath>
|
|
||||||
</RootPath>
|
|
||||||
<RootNamespace>TestProjectName</RootNamespace>
|
|
||||||
<AssemblyName>TestProjectName</AssemblyName>
|
|
||||||
<ModelCollation>1033, CI</ModelCollation>
|
|
||||||
<DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
|
|
||||||
<DeployToDatabase>True</DeployToDatabase>
|
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
|
||||||
<TargetLanguage>CS</TargetLanguage>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<SqlServerVerification>False</SqlServerVerification>
|
|
||||||
<IncludeCompositeObjects>True</IncludeCompositeObjects>
|
|
||||||
<TargetDatabaseSet>True</TargetDatabaseSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
|
|
||||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<DefineDebug>false</DefineDebug>
|
|
||||||
<DefineTrace>true</DefineTrace>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
|
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<DefineDebug>true</DefineDebug>
|
|
||||||
<DefineTrace>true</DefineTrace>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
|
|
||||||
<!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
|
|
||||||
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
|
|
||||||
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Condition="'$(NetCoreBuild)' != 'true' AND '$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets"/>
|
|
||||||
<Import Condition="'$(NetCoreBuild)' != 'true' AND '$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets"/>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Properties" />
|
|
||||||
<Folder Include="Tables" />
|
|
||||||
<Folder Include="Views" />
|
|
||||||
<Folder Include="Views\Maintenance" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Build Include="Tables\Users.sql" />
|
|
||||||
<Build Include="Tables\Action History.sql" />
|
|
||||||
<Build Include="Views\Maintenance\Database Performance.sql" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Views\User" />
|
|
||||||
<Build Include="Views\User\Profile.sql" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Condition="'$(NetCoreBuild)' == 'true'" Project="$(NETCoreTargetsPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets"/>
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Condition="'$(NetCoreBuild)' == 'true'" Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All"/>
|
|
||||||
</ItemGroup>
|
|
||||||
<Target Name="AfterClean">
|
|
||||||
<Delete Files="$(BaseIntermediateOutputPath)\project.assets.json"/>
|
|
||||||
</Target>
|
|
||||||
<ItemGroup>
|
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)\SystemDacpacs\130\master.dacpac">
|
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
|
||||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
|
||||||
</ArtifactReference>
|
|
||||||
<ArtifactReference Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\msdb.dacpac">
|
|
||||||
<HintPath>$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\msdb.dacpac</HintPath>
|
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
|
||||||
<DatabaseVariableLiteralValue>msdb</DatabaseVariableLiteralValue>
|
|
||||||
</ArtifactReference>
|
|
||||||
<ArtifactReference Condition="'$(NetCoreBuild)' != 'true'" Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac">
|
|
||||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
|
||||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
|
||||||
</ArtifactReference>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -11,11 +11,8 @@ export let newProjectFileBaseline: string;
|
|||||||
export let openProjectFileBaseline: string;
|
export let openProjectFileBaseline: string;
|
||||||
export let openDataSourcesBaseline: string;
|
export let openDataSourcesBaseline: string;
|
||||||
export let SSDTProjectFileBaseline: string;
|
export let SSDTProjectFileBaseline: string;
|
||||||
export let SSDTProjectAfterUpdateBaselineWindows: string;
|
|
||||||
export let SSDTProjectAfterUpdateBaseline: string;
|
export let SSDTProjectAfterUpdateBaseline: string;
|
||||||
export let SSDTUpdatedProjectBaselineWindows: string;
|
|
||||||
export let SSDTUpdatedProjectBaseline: string;
|
export let SSDTUpdatedProjectBaseline: string;
|
||||||
export let SSDTUpdatedProjectAfterSystemDbUpdateBaselineWindows: string;
|
|
||||||
export let SSDTUpdatedProjectAfterSystemDbUpdateBaseline: string;
|
export let SSDTUpdatedProjectAfterSystemDbUpdateBaseline: string;
|
||||||
export let SSDTProjectBaselineWithCleanTarget: string;
|
export let SSDTProjectBaselineWithCleanTarget: string;
|
||||||
export let SSDTProjectBaselineWithCleanTargetAfterUpdate: string;
|
export let SSDTProjectBaselineWithCleanTargetAfterUpdate: string;
|
||||||
@@ -28,11 +25,8 @@ export async function loadBaselines() {
|
|||||||
openProjectFileBaseline = await loadBaseline(baselineFolderPath, 'openSqlProjectBaseline.xml');
|
openProjectFileBaseline = await loadBaseline(baselineFolderPath, 'openSqlProjectBaseline.xml');
|
||||||
openDataSourcesBaseline = await loadBaseline(baselineFolderPath, 'openDataSourcesBaseline.json');
|
openDataSourcesBaseline = await loadBaseline(baselineFolderPath, 'openDataSourcesBaseline.json');
|
||||||
SSDTProjectFileBaseline = await loadBaseline(baselineFolderPath, 'SSDTProjectBaseline.xml');
|
SSDTProjectFileBaseline = await loadBaseline(baselineFolderPath, 'SSDTProjectBaseline.xml');
|
||||||
SSDTProjectAfterUpdateBaselineWindows = await loadBaseline(baselineFolderPath, 'SSDTProjectAfterUpdateBaselineWindows.xml');
|
|
||||||
SSDTProjectAfterUpdateBaseline = await loadBaseline(baselineFolderPath, 'SSDTProjectAfterUpdateBaseline.xml');
|
SSDTProjectAfterUpdateBaseline = await loadBaseline(baselineFolderPath, 'SSDTProjectAfterUpdateBaseline.xml');
|
||||||
SSDTUpdatedProjectBaselineWindows = await loadBaseline(baselineFolderPath, 'SSDTUpdatedProjectBaselineWindows.xml');
|
|
||||||
SSDTUpdatedProjectBaseline = await loadBaseline(baselineFolderPath, 'SSDTUpdatedProjectBaseline.xml');
|
SSDTUpdatedProjectBaseline = await loadBaseline(baselineFolderPath, 'SSDTUpdatedProjectBaseline.xml');
|
||||||
SSDTUpdatedProjectAfterSystemDbUpdateBaselineWindows = await loadBaseline(baselineFolderPath, 'SSDTUpdatedProjectAfterSystemDbUpdateBaselineWindows.xml');
|
|
||||||
SSDTUpdatedProjectAfterSystemDbUpdateBaseline = await loadBaseline(baselineFolderPath, 'SSDTUpdatedProjectAfterSystemDbUpdateBaseline.xml');
|
SSDTUpdatedProjectAfterSystemDbUpdateBaseline = await loadBaseline(baselineFolderPath, 'SSDTUpdatedProjectAfterSystemDbUpdateBaseline.xml');
|
||||||
SSDTProjectBaselineWithCleanTarget = await loadBaseline(baselineFolderPath, 'SSDTProjectBaselineWithCleanTarget.xml');
|
SSDTProjectBaselineWithCleanTarget = await loadBaseline(baselineFolderPath, 'SSDTProjectBaselineWithCleanTarget.xml');
|
||||||
SSDTProjectBaselineWithCleanTargetAfterUpdate = await loadBaseline(baselineFolderPath, 'SSDTProjectBaselineWithCleanTargetAfterUpdate.xml');
|
SSDTProjectBaselineWithCleanTargetAfterUpdate = await loadBaseline(baselineFolderPath, 'SSDTProjectBaselineWithCleanTargetAfterUpdate.xml');
|
||||||
|
|||||||
@@ -5,18 +5,16 @@
|
|||||||
|
|
||||||
import * as should from 'should';
|
import * as should from 'should';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as os from 'os';
|
|
||||||
import * as baselines from './baselines/baselines';
|
import * as baselines from './baselines/baselines';
|
||||||
import * as testUtils from './testUtils';
|
import * as testUtils from './testUtils';
|
||||||
import * as constants from '../common/constants';
|
import * as constants from '../common/constants';
|
||||||
|
|
||||||
import { promises as fs } from 'fs';
|
import { promises as fs } from 'fs';
|
||||||
import { Project, EntryType, TargetPlatform, SystemDatabase, DatabaseReferenceLocation } from '../models/project';
|
import { Project, EntryType, TargetPlatform, SystemDatabase, DatabaseReferenceLocation } from '../models/project';
|
||||||
import { exists } from '../common/utils';
|
import { exists, convertSlashesForSqlProj } from '../common/utils';
|
||||||
import { Uri } from 'vscode';
|
import { Uri } from 'vscode';
|
||||||
|
|
||||||
let projFilePath: string;
|
let projFilePath: string;
|
||||||
const isWindows = os.platform() === 'win32';
|
|
||||||
|
|
||||||
describe('Project: sqlproj content operations', function (): void {
|
describe('Project: sqlproj content operations', function (): void {
|
||||||
before(async function (): Promise<void> {
|
before(async function (): Promise<void> {
|
||||||
@@ -63,8 +61,8 @@ describe('Project: sqlproj content operations', function (): void {
|
|||||||
const newProject = new Project(projFilePath);
|
const newProject = new Project(projFilePath);
|
||||||
await newProject.readProjFile();
|
await newProject.readProjFile();
|
||||||
|
|
||||||
should(newProject.files.find(f => f.type === EntryType.Folder && f.relativePath === folderPath)).not.equal(undefined);
|
should(newProject.files.find(f => f.type === EntryType.Folder && f.relativePath === convertSlashesForSqlProj(folderPath))).not.equal(undefined);
|
||||||
should(newProject.files.find(f => f.type === EntryType.File && f.relativePath === filePath)).not.equal(undefined);
|
should(newProject.files.find(f => f.type === EntryType.File && f.relativePath === convertSlashesForSqlProj(filePath))).not.equal(undefined);
|
||||||
|
|
||||||
const newFileContents = (await fs.readFile(path.join(newProject.projectFolderPath, filePath))).toString();
|
const newFileContents = (await fs.readFile(path.join(newProject.projectFolderPath, filePath))).toString();
|
||||||
|
|
||||||
@@ -164,14 +162,14 @@ describe('Project: sqlproj content operations', function (): void {
|
|||||||
should(project.databaseReferences[0].databaseName).equal(constants.master, 'The database reference should be master');
|
should(project.databaseReferences[0].databaseName).equal(constants.master, 'The database reference should be master');
|
||||||
// make sure reference to SSDT master dacpac was added
|
// make sure reference to SSDT master dacpac was added
|
||||||
let projFileText = (await fs.readFile(projFilePath)).toString();
|
let projFileText = (await fs.readFile(projFilePath)).toString();
|
||||||
should(projFileText).containEql(project.getSystemDacpacSsdtUri(constants.master).fsPath.substring(1));
|
should(projFileText).containEql(convertSlashesForSqlProj(project.getSystemDacpacSsdtUri(constants.master).fsPath.substring(1)));
|
||||||
|
|
||||||
await project.addSystemDatabaseReference(SystemDatabase.msdb);
|
await project.addSystemDatabaseReference(SystemDatabase.msdb);
|
||||||
should(project.databaseReferences.length).equal(2, 'There should be two database references after adding a reference to msdb');
|
should(project.databaseReferences.length).equal(2, 'There should be two database references after adding a reference to msdb');
|
||||||
should(project.databaseReferences[1].databaseName).equal(constants.msdb, 'The database reference should be msdb');
|
should(project.databaseReferences[1].databaseName).equal(constants.msdb, 'The database reference should be msdb');
|
||||||
// make sure reference to SSDT msdb dacpac was added
|
// make sure reference to SSDT msdb dacpac was added
|
||||||
projFileText = (await fs.readFile(projFilePath)).toString();
|
projFileText = (await fs.readFile(projFilePath)).toString();
|
||||||
should(projFileText).containEql(project.getSystemDacpacSsdtUri(constants.msdb).fsPath.substring(1));
|
should(projFileText).containEql(convertSlashesForSqlProj(project.getSystemDacpacSsdtUri(constants.msdb).fsPath.substring(1)));
|
||||||
|
|
||||||
await project.addDatabaseReference(Uri.parse('test.dacpac'), DatabaseReferenceLocation.sameDatabase);
|
await project.addDatabaseReference(Uri.parse('test.dacpac'), DatabaseReferenceLocation.sameDatabase);
|
||||||
should(project.databaseReferences.length).equal(3, 'There should be three database references after adding a reference to test');
|
should(project.databaseReferences.length).equal(3, 'There should be three database references after adding a reference to test');
|
||||||
@@ -208,15 +206,11 @@ describe('Project: round trip updates', function (): void {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Should update SSDT project to work in ADS', async function (): Promise<void> {
|
it('Should update SSDT project to work in ADS', async function (): Promise<void> {
|
||||||
const fileBeforeUpdate = baselines.SSDTProjectFileBaseline;
|
await testUpdateInRoundTrip( baselines.SSDTProjectFileBaseline, baselines.SSDTProjectAfterUpdateBaseline, true, true);
|
||||||
const fileAfterUpdate = isWindows ? baselines.SSDTProjectAfterUpdateBaselineWindows : baselines.SSDTProjectAfterUpdateBaseline;
|
|
||||||
await testUpdateInRoundTrip(fileBeforeUpdate, fileAfterUpdate, true, true);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should update SSDT project with new system database references', async function (): Promise<void> {
|
it('Should update SSDT project with new system database references', async function (): Promise<void> {
|
||||||
const fileBeforeUpdate = isWindows ? baselines.SSDTUpdatedProjectBaselineWindows : baselines.SSDTUpdatedProjectBaseline;
|
await testUpdateInRoundTrip(baselines.SSDTUpdatedProjectBaseline, baselines.SSDTUpdatedProjectAfterSystemDbUpdateBaseline, false, true);
|
||||||
const fileAfterUpdate = isWindows ? baselines.SSDTUpdatedProjectAfterSystemDbUpdateBaselineWindows : baselines.SSDTUpdatedProjectAfterSystemDbUpdateBaseline;
|
|
||||||
await testUpdateInRoundTrip(fileBeforeUpdate, fileAfterUpdate, false, true);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should update SSDT project to work in ADS handling pre-exsiting targets', async function (): Promise<void> {
|
it('Should update SSDT project to work in ADS handling pre-exsiting targets', async function (): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user