This is a demo application for the schema management tool. It requires a CF DSN configured (named 'schema_tool_demo' - can be changed in Application.cfm), and a 'schema_tool_demo' mapping pointed at the directory containing this file. The actual "useful" stuff are the CFCs in the 'schema_tool' directory. The two CFM files in this directory and the *_scripts directories are the demo files. In a nutshell, I should be called at the beginning of application startup (before ColdSpring gets initialized, for example), and will ensure the current schema is up to date. This allows schema changes to be scripted and automatically applied in exactly the same way in all environments that you run your application in. It manages itself via a 'schema_version' table in the database itself, so multiple deployments that share a database backend (such as multiple load-balanced web servers sharing a DB server) will not cause problems with schema updates being applied twice unless they are initialized concurrently. It is also now possible to use the tool in isolation of a database. For example, to script CF Admin API changes. You can request a filesystem tool from the tool factory to accomplish this. Note that using this mechanism provides to DSN to your migration scripts, which means you can't used scripts written in SQL, and if you want to do queries inside scripts written as CFCs, you'll have to get your DSN some other way. The main point of interest in the demo is lines 45-46 of Application.cfm, along with the migration scripts themselves in the *_scripts directories. In most cases the schema_tool directory should be managed as a vendor branch (and quite possibly shared between applications) and your migration scripts should be located wherever you keep your other CFCs (I use a x.y.z.schema_scripts package for them). This facilitates easier upgrades (or use of svn:externals) for the core code. ------------------------------------------------------------------------ $Id$ Copyright 2007 Barney Boisvert (bboisvert@gmail.com). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.