Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Automate Updating Database Project Nightly For Code Review

$
0
0

My company has just started to use database projects as a code review tool, utilizing the compiler engine. I’m trying to automate maintaining the database project with the current database changes during the nightly build process. Using TFS 2010, I created a custom build activity that automates Visual Studio by using EnvDTE. Below are the steps performed by the build activity:

  1. Launch instance of Visual Studio IDE
  2. Open solution that contains database project
  3. Wait fixed amount of time for Visual Studio to verify that the model is synchronized with the source files since I couldn’t find an event that triggers when finished
  4. Perform schema compare (running Visual Studio Data.NewSchemaComparison command)
  5. Wait fixed amount of time (e.g. thread.sleep) for Visual Studio to finish schema compare since I couldn’t find an event that triggers when finished
  6. Perform ‘Write Updates’ action (running Visual Studio Data.SchemaCompareWriteUpdates command)
  7. Programmatically click ‘Yes’ button on dialog that confirms that I want to update the target
  8. Wait fixed amount of time for Visual Studio to perform ‘Write Updates’ action
  9. Programmatically click the ‘OK’ button on the dialog that confirms that target schema was updated successfully
  10. Wait fixed amount of time for Visual Studio reanalyze after write updates operation
  11. Save all changes (running Visual Studio SaveAll command)
  12. Programmatically click ‘Save’ button to save the schemacompare file and other changes to the database project (e.g. adding/modifying files)

Then I have another activity that will check-in the changes to TFS.

The DB project is very large with around 35000 objects; My company is not ready to replace the existing database deployment mechanism that have been developed prior to DB projects being available. Is there a better way to automate maintaining the database project? If not, then is there any way to suppress the dialogs launched from the Data.SchemaCompareWriteUpdates and SaveAll commands? Is there a way to detect when an operation completes (e.g. schema compare) using the Visual Studio commands instead of using a thread.sleep to wait a fixed period of time?

thank you,

Steve


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>