views:

21

answers:

1

Short version:
Is there a way to use rake without the full rails environment/active record to manage a SQL Server database? Are there alternatives to rake to do so that provide the same feature set?

Longer version:
I've done some hobby development using Rails but I haven't used it for work nor do I intend to. But from using it, one thing (among others, of course) that stuck out was how intuitive I found rake db:migrate to be from the standpoint of managing the development life cycle of the database.

I particularly like:

  • All scripts are ordered for execution with upgrade/downgrade steps separated.
  • Table generation is inherently scripted (doesn't rely on Management Studio UI to click click click.
  • Data insertion is explicit as a version/step.
  • Ease of use

What kind of options are there out there for doing this type of management on a SQL Server database for the lone coder?

A: 

rake db:migrate only makes easy migrations easier.

Bigger migrations are still just as hard, and require thinking about the schema changes in terms of what the database actually has to do.

Anyway, I think you're kind of stuck using the entire thing, because db:migrate isn't a database-centric migration - it's really model-centric.

Typically, I like to use something like SQL Compare to go from current production to next production schema.

I do not tend to run multiple migrations to go from 1.0.1 (Release) -> 1.0.2 (Dev) -> 1.0.3 (Dev) -> 1.1.0 (Release) (i.e. the scripts developers used to get to different internal releases), because i want to upgrade a staging environment from one production release to the next production release directly just like it's going to happen for production. There are always possibilities that the scripts won't work on real data (or they'll be too slow, or there will be referential integrity issues with the real data).

As far as scripting, this is available through SMO, or with tools like Red Gate's or APEX SQLScript.

Cade Roux