Changes to add pre/post deploy script to sqlproj (#11864)

* Initial changes for adding pre/post deploy script in project

* Right click > Add pre/post deploy script

* Print script files in tree

* Add new pre-post deploy items with their own tags and additional ones with None

* Add tests

* Fix error due to merge conflicts

* Addressed comments and fixed tests.

* Fix code scan error

* Addressed comments
This commit is contained in:
Sakshi Sharma
2020-08-27 10:50:02 -07:00
committed by GitHub
parent fa664bc92f
commit 21c8609eb7
12 changed files with 160 additions and 17 deletions

View File

@@ -16,6 +16,8 @@ export const table: string = 'table';
export const view: string = 'view';
export const storedProcedure: string = 'storedProcedure';
export const folder: string = 'folder';
export const preDeployScript: string = 'preDeployScript';
export const postDeployScript: string = 'postDeployScript';
// Object maps
@@ -45,7 +47,9 @@ export async function loadTemplates(templateFolderPath: string) {
loadObjectTypeInfo(script, constants.scriptFriendlyName, templateFolderPath, 'newTsqlScriptTemplate.sql'),
loadObjectTypeInfo(table, constants.tableFriendlyName, templateFolderPath, 'newTsqlTableTemplate.sql'),
loadObjectTypeInfo(view, constants.viewFriendlyName, templateFolderPath, 'newTsqlViewTemplate.sql'),
loadObjectTypeInfo(storedProcedure, constants.storedProcedureFriendlyName, templateFolderPath, 'newTsqlStoredProcedureTemplate.sql')
loadObjectTypeInfo(storedProcedure, constants.storedProcedureFriendlyName, templateFolderPath, 'newTsqlStoredProcedureTemplate.sql'),
loadObjectTypeInfo(preDeployScript, constants.preDeployScriptFriendlyName, templateFolderPath, 'newTsqlPreDeployScriptTemplate.sql'),
loadObjectTypeInfo(postDeployScript, constants.postDeployScriptFriendlyName, templateFolderPath, 'newTsqlPostDeployScriptTemplate.sql')
]);
for (const scriptType of scriptTypes) {