Cedar City Group: I'll get off of the SubSonic Kick.....

Friday, December 14, 2007

I'll get off of the SubSonic Kick.....

At some point but not right now.

Yesterday, I was posting some recent web site changes to a test site. For the last couple of projects that I've worked on, I've had access to SQLCompare which is a darn good product. I have encouraged several companies to buy it, though I don't have a copy of my own. Anyway, I had a bunch of database changes to make, no SQLCompare to synchronize, what do you do?

Subsonic to the rescue. With a few rules to follow, Subsonic provides a cool mechanism for upgrading your database. Subcommander provides a /version option which will create two scripts. One script will create the schema for the configured database, the other will create a script that will recreate the data. Pretty cool stuff. I 'versioned' the new database and the destination database. Run the new schema script on the destination db, then run the destination data script to re-insert the data.

Obviously, there are some rules here: you can't delete columns, or tables (without modifying the data script). But this provides a cool mechanism for developers.

How many times have you need to duplicate a database for development purposes? You want a development, testing and production version of your database. You can use backup/restore to create a new database but this provides a quick mechanism for duplicating that is very easy to understand.

There are many uses for this utility, creating your initial install scripts, version control of schema (and data!) also, though I've not checked this out yet, but a poor man's SQL Compare could be created with the combination of SubSonic and a text comparison tool like csdiff.

Pretty cool stuff, Thanks guys.

0 comments: