Schema Tool Update

I've just released a new version of my Schema Tool that won me a Wii. The major feature is SQL-based migration scripts, so you don't have to build big nasty CFSWITCH statements if you don't want to. To accommodate that, I've refactored the migration hierarchy, and deprecated BaseMigration. There is a new SwitchBasedMigration class that is a direct replacement and should be used instead. For the moment, BaseMigration is still present, but it'll be removed eventually.

The SQL-based scripts can be really nice if all your transformations are in the database and don't require programming to do. Just drop a SQL file in the migration scripts directory with a .sql extension (following the same naming conventions for the filename root), and it'll automatically get picked up as a script and executed. Minor versions considered one per statement. Not that this means you don't get multi-statement minor versions (you still have to use a CF-based script for that), which by extension means you can't do your own transaction demarcation. Like the CF-based scripts, each minor version corresponds to a transaction, and it's managed for you.

There are examples of both in the demo app (linked above). If you're building an app and want to use it, all you care about is the actual 'schema_tool' directory, and the invocation syntax in Application.cfm.

The source (of the zip linked above) is available from my SVN repository as well, at, if you'd prefer that. For my projects, I use an svn:externals definition pointing at to link in the core, so I can get transparent updates when I want them. If you don't want bleeding edge, make sure you use a revision number, but I use bleeding edge on all my projects, so an expectation of stability is reasonably fair.

Comments are closed.