sql - ssdt post deployment script run once -


i new sql server database tools , may making incorrect assumptions post deployment scripts doing.. correct me if wrong.

as far aware post deployment script expected run after every deployment, not single deployment.

if want have post deployment script run script 1 time there way without requiring version or history table in database logs when these scripts ran?

i.e. can have subsequent amendments script added new file within project version number on, , add post deployment script have previous script ignored how (potentially without first removing it)? regardless of whether still runs script during deployment?

is there configuration sort of thing or unintended behaviour?

pre , post-deploy scripts designed run each time release project. best practice make them repeatable. add checks if data exists, don't run again or similar. build sort of basic logging table store - if row not found in table, run script , put row in table.

you can't tell project run latest version of script if there multiple scripts present because they're built 1 large predeploy.sql or postdeploy.sql file. you'd need within each section/script tell know whether or not run. existing data check, table check, version check, or else, need know somewhere use know whether or not run.

there's no way turn off other commenting out scripts or handling them in way through sqlcmd variables or other checks. still require coding in way each script should run or not. if give example or 2 of you're trying accomplish in pre/post deploy scripts, can give better guidance.

for our purposes, make scripts re-usable , remove them they've been run. they're still in source control or can use snapshot store version of project prior removing them.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -