User login

CFWheels DBMigrate plugin

Started with http://code.google.com/p/cfwheels-dbmigrate/ which last released 0.6 in October 2010.
Now trying the 0.8.2 release of its fork on Github, https://github.com/charliecochran/cfwheels-dbmigrate-plugin

We use the plugin CF DB Migrate for all updates we need to make to our application's database. (The Ruby on Rails and CF on Wheels crowd calls updating schema and data in your application migrating data.) DB Migrate takes care of keeping track of what was the last update to run (in a 'schemainfo' table it creates in your application database), and provides for rollback capability when it is possible for us to write 'down' statements to accompany the 'up' statements for updates.

  • Do one thing in each migration (what would be one SQL statement). DBMigrate has no internal rollback capability. It can only run your 'down' statements (if the 'up' was successful. If the there are several statements in one file, and the first one works but the second fails, DBMigrate has run part of, say, 002 but will list 002 as un-run and try to run it from the beginning on another try. Related:
  • Always back up your database before running a migration.
  • Go to rewrite.cfm?controller=wheels&action=wheels&view=plugins&name=dbmigrate to run the migration (index.cfm at the start may not work)

See http://code.google.com/p/cfwheels-dbmigrate/w/list (especially as easiest way to look up different column types)

Creating a new table

A primary key named id will automatically be added by default when you create a table.

http://code.google.com/p/cfwheels-dbmigrate/wiki/TutorialCreate

Updating data (not schema)

http://code.google.com/p/cfwheels-dbmigrate/wiki/APIMigrationUpdateRecord

Varchar is String

For changeColumn columnType definitions or addColumn, varchar is string:
http://code.google.com/p/cfwheels-dbmigrate/wiki/APITableDefinitionString

More

http://code.google.com/p/cfwheels-dbmigrate/wiki/APITableDefinitionInteger
http://code.google.com/p/cfwheels-dbmigrate/wiki/APITableDefinitionDate

http://code.google.com/p/cfwheels-dbmigrate/wiki/APIMigrationAddColumn

http://code.google.com/p/cfwheels-dbmigrate/wiki/TutorialModify

Searched words: 
data schema updates coldfusion on wheels

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.