timestamp = now();
// set up ColdSpring properties
application.config = structNew();
application.config.dsn = "schema_tool_demo";
// this is the path to use for the non-database version info.
// Don't put it in your approot as I have done. I've only placed it there to make the demo simpler to run
application.config.configSchemaVersionStatePath = expandPath("filesystem_version_state.txt");
createObject("component", "schema_tool.toolfactory").getTool("database", "schema_tool_demo.database_scripts", application.config.dsn).ensureCurrent("#application.applicationname#.schema_tool");
createObject("component", "schema_tool.toolfactory").getTool("filesystem", "schema_tool_demo.config_scripts", application.config.configSchemaVersionStatePath).ensureCurrent("#application.applicationname#.schema_tool");
/* It's important that the schema tool does NOT get wired into
ColdSpring, and that it runs BEFORE ColdSpring is initialized, so
that any bean startup code that depends on the schema being up to
date will run successfully. Further, the schema tool should not
have any dependencies to your application code
application.factory = createObject("component", "coldspring.beans.DefaultXmlBeanFactory").init();
application.factory.setDefaultProperties(application.config);
application.factory.loadBeansFromXmlFile(getDirectoryFromPath(getCurrentTemplatePath()) & "applicationContext.xml", true);
*/
application[APP_LOADED_KEY] = timestamp;