Skip to content
Troy Murray edited this page Sep 15, 2011 · 1 revision

Thoughts on cftransaction and why there are two versions

In version 0.3 we introduced cftransaction tags around the migration code with the aim that while you were coding, if your migration contained an error it would be rolled back.

However this created an issue for using the model() function for CFWheels 1.0.1 and up (see Issue 7 for details).

The cftransaction tag makes use of the underlying database transaction commands which generally only rollback changes to data, not structural changes such as CREATE, ALTER, DROP TABLE etc. Personally I think that using the model() command is preferable for making changes to your data in your migrations, instead of custom queries or the other migration functions (addRecord, updateRecord, removeRecord) as it will consider any callbacks or validation rules you have setup on your model. So as cftransaction prevents you using the model() function I have removed cftransaction from the main plugin, but have also provided an alternate version to download on this Google Code site for those who want it.

Feel free to send me your thoughts on this issue.

Clone this wiki locally