RE: [CFCDEV] Rails-Style Migrations (for fun and profit?)
Eric, I'm interested in seeing it. Let us know if and where you are releasing it. --Ryan From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric O'Connell Sent: Friday, July 13, 2007 11:29 AM To: cfcdev@cfczone.org Subject: [CFCDEV] Rails-Style Migrations (for fun and profit?) 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] 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 - The information in this message may be proprietary and/or confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify First Data immediately by replying to this message and deleting it from your computer. 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
Re: [CFCDEV] Rails-Style Migrations (for fun and profit?)
Have you looked at my schema management tool. It's not quite the same idea, but reasonably close. Definitely covers the make sure the database schemas are in sync job. I just released an update not 10 minutes ago at http://www.barneyb.com/barneyblog/2007/07/13/schema-tool-update/. cheers, barneyb On 7/13/07, Eric O'Connell [EMAIL PROTECTED] wrote: 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] 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 -- Barney Boisvert [EMAIL PROTECTED] http://www.barneyb.com/ Got Gmail? I have 100 invites. 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
Re: [CFCDEV] Rails-Style Migrations (for fun and profit?)
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
Re: [CFCDEV] Rails-Style Migrations (for fun and profit?)
Sam, If you are looking for a CFC-based ActiveSchema solution, I would humbly suggest you take a look at DataMgr: http://steve.coldfusionjournal.com/schema_synchronization_with_datamgr.htm Same syntax for any supported database. No custom tags. No need to write any SQL. Only adds tables/columns, though, no way to go back in time (open to suggestions though). Steve At 01:48 PM 7/13/2007, Sammy Larbi wrote: 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 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