Update system database references from SSDT (#10891)

* convert system database references from SSDT

* remove empty ItemGroup if no other database references

* fix baseline files

* also update sqlproj if system database references were added in SSDT since the sqlproj got updated with ADS imports

* undo change

* move updating system db references out of updateProjectForRoundTrip()

* update test to have an already updated system db ref

* add clean target after merge from master

* add await

* addressing comments
This commit is contained in:
Kim Santiago
2020-06-12 17:57:11 -07:00
committed by GitHub
parent 233646330e
commit c9569d8573
12 changed files with 553 additions and 18 deletions

View File

@@ -443,13 +443,21 @@ export class ProjectsController {
}
public async updateProjectForRoundTrip(project: Project) {
if (project.importedTargets.includes(constants.NetCoreTargets)) {
if (project.importedTargets.includes(constants.NetCoreTargets) && !project.containsSSDTOnlySystemDatabaseReferences()) {
return;
}
const result = await this.apiWrapper.showWarningMessage(constants.updateProjectForRoundTrip, constants.yesString, constants.noString);
if (result === constants.yesString) {
await project.updateProjectForRoundTrip();
if (!project.importedTargets.includes(constants.NetCoreTargets)) {
const result = await this.apiWrapper.showWarningMessage(constants.updateProjectForRoundTrip, constants.yesString, constants.noString);
if (result === constants.yesString) {
await project.updateProjectForRoundTrip();
await project.updateSystemDatabaseReferencesInProjFile();
}
} else if (project.containsSSDTOnlySystemDatabaseReferences()) {
const result = await this.apiWrapper.showWarningMessage(constants.updateProjectDatabaseReferencesForRoundTrip, constants.yesString, constants.noString);
if (result === constants.yesString) {
await project.updateSystemDatabaseReferencesInProjFile();
}
}
}