visual studio 2013 - How to modify actual data once only from a SQL Server Database Project? -


i have sql server database project in visual studio 2013 couple of;

  • tables
  • stored procedures
  • some postdeployment scripts

i leave tables , stored procedures now, , focus on postdeployment scripts, feel ones interesting question.

say example want remove data caused bug. bug has been fixed i'd set database better state removing "wrong" information. need script executed once-only ever. change-script approach trivial, cannot find solution type of database project.

postdeployment scripts executed after each deploy, meaning cannot meaningful once-only change actual data here.

i could include if statement in scipt check data before making change, preventing being executed multiple times, i'd prefer rely on tools rather user-written if statement.

i feel use case rather simple, yet cannot find solution it. how shall approach this? tips!

credit pieter geerkens:

write idempotent script - developers on regular basis manage problem describe.


this seem way to. reason why didn't want take approach @ first because will execute script during each publish. in future if data again satisfies conditions data might again updated / deleted / removed, , i'd prefer not happen.

for reference: idempotent


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -