Hi Eric,
I actually didn't implement all that much in cfrails - simple up and
down for tables only, and you are right - it only works in MS SQL Server
(mainly due to the column type name differences for autonumber fields).
Other than that, I think I've left the column type up to the developer
to avoid having to abstract that out myself (although this will
eventually change). Another glaring hole is that the included runner
doesn't respect version numbers, so you cannot go up and down to
specific instances in time (without writing your own script). I also
plan to change that behavior.
That said, migrations are low on the list of things I need to do for
cfrails.
In any case, I do see value in it. I'm trying to move away from tags,
so I probably wouldn't use this version, but I'm sure some people prefer
tags!
Sam
Eric O'Connell wrote, On 7/13/2007 10:28 AM:
Hi folks,
I started to get anxious about keeping my developer and production
database schemas in sync, so I decided to implement a rails-style
migration functionality. I'd already implemented about 90% of it when
I came across cf_rails, but I thought I'd show it off anyway. Like
cf_rails, it is currently mssql-only, but a connection adaptor layer
could be added fairly easily.
Anyway, here's what the migration syntax looks like:
<cf_create_table tableName="foo" force="true">
<cf_column name="bar" type="varchar">
<cf_column name="baaz" type="integer">
</cf_create_table>
<cf_add_column tableName="foo" name="quux" type="datetime">
<cf_remove_column tableName="foo" name="baaz">
<cf_drop_table tableName="foo">
And here is an actual migration script:
<cfcomponent extends="com.iba.migration.instance" output="yes">
<cffunction name="up" returnType="void" output="no" access="remote">
<cf_add_column tableName="cart" name="discountCode" type="varchar(30)">
</cffunction>
<cffunction name="down" returnType="void" output="no" access="remote">
<cf_remove_column tableName="cart" name="discountCode">
</cffunction>
</cfcomponent>
If anyone is interested in it, I could clean it up and release it. If
not, oh well :)
Eric O'Connell
IBA Webmaster
-
941-921-7443 x15
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
www.bodytalksystem.com
You are subscribed to cfcdev. To unsubscribe, please follow the
instructions at http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/cfcdev@cfczone.org
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at
http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/cfcdev@cfczone.org