DBMigrate 0.8.0 Update

14 views
Skip to first unread message

Troy Murray

unread,
Sep 21, 2011, 10:11:02 AM9/21/11
to cfwheels
I've updated the DBMigrate plugin
(https://github.com/talltroym/cfwheels-dbmigrate-plugin) to version
0.8.0.

Besides fixing a few bugs, I'm excited to have added a feature that I
really wanted, which is the ability to perform migrations by calling a
URL with parameters. So now on my test/production servers in my bash
script that deploys my application from my ZIP file, it performs three
wget calls (one to change to maintenance mode, one to migrate to the
latest database version and one to change to production mode) to
migrate to the latest version of my database and reload the
application.

To perform migrations via URL here's what I have in my script:

wget --no-check-certificate --no-cache --no-cookies --quiet
"https://<domain-name-here>/rewrite.cfm?controller=wheels&action=wheels&view=plugins&name=dbmigrate&password=<cfwheels-reload-password-here>&migrateToVersion=99999999999999"
-O /tmp/deploy/migrate.out

Use "migrateToVersion=99999999999999" to migrate to the latest version
of your database.
Use "migrateToVersion=0" to remove all migrations from your database
Use "migrateToVersion=12345678912345" to migrate to that specific
database version


The complete changlog is at
https://github.com/talltroym/cfwheels-dbmigrate-plugin/blob/master/CHANGELOG.md

Troy Murray

unread,
Sep 21, 2011, 10:11:46 AM9/21/11
to cfwheels
I forgot to note that I sent this new version to Ryan H to update the
CFWheels plugin website, but he hasn't been able to post the updated
ZIP yet. So if you want this now, you'll have to pull it from GitHub.

--
Troy Murray

Chris Peters

unread,
Sep 21, 2011, 10:49:48 AM9/21/11
to cfwh...@googlegroups.com
Very nice! The new URL functionality is nice because you can run them from deployment scripts AND it will be very helpful to anyone writing an app with an installer script.

On Wed, Sep 21, 2011 at 10:11 AM, Troy Murray <troy....@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To post to this group, send email to cfwh...@googlegroups.com.
To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfwheels?hl=en.


Russ Johnson

unread,
Sep 21, 2011, 8:13:42 PM9/21/11
to cfwh...@googlegroups.com
Great work on the additions! Noticed that theres some documentation on the GitHub wiki now too, sweet!

One question about migrations that I have never given any thought to until now. Im building a new site that requires multi-lingual capabilities so the table encoding and collation need to be set to utf-8. Is there anything in the migration methods that allow me to set that? I was looking over the docs but didn't see anything jump out at me…

Thanks !

- Russ

ryanhoppitt

unread,
Sep 21, 2011, 9:04:52 PM9/21/11
to ColdFusion on Wheels
Now updated on the CFWheels site:
http://cfwheels.org/plugins/listing/28

Is there any way to share edit access to a plugins page on CFWheels
site with other people?

Ryan
> >https://github.com/talltroym/cfwheels-dbmigrate-plugin/blob/master/CH...
>
> --
> Troy Murray

Troy Murray

unread,
Sep 22, 2011, 12:29:03 AM9/22/11
to cfwh...@googlegroups.com
Russ,

I haven't had to deal with that situation yet. Which DB are you using?

-t

--
Troy Murray

Russ Johnson

unread,
Sep 22, 2011, 1:00:10 AM9/22/11
to cfwh...@googlegroups.com
Its MySQL…

Here's the create table syntax for one of my tables… notice the last two attributes..

CREATE TABLE `snippets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) CHARACTER SET latin1 DEFAULT NULL,
`filename` varchar(39) CHARACTER SET latin1 DEFAULT NULL,
`content` text CHARACTER SET latin1,
`createdByID` int(11) DEFAULT NULL,
`updatedByID` int(11) DEFAULT NULL,
`createdat` datetime DEFAULT NULL,
`updatedat` datetime DEFAULT NULL,
`deletedat` datetime DEFAULT NULL,
`categoryid` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Troy Murray

unread,
Sep 22, 2011, 10:46:41 AM9/22/11
to cfwh...@googlegroups.com
Russ,

Right now DBMigrate doesn't specify these two atributes. However,
from what I understand, you can set this on a DATABASE level rather
then a table level. So if you CREATE or ALTER the database for utf8
then all of the tables you create with DBMigrate should have that set.

CREATE DATABASE db_name
[[DEFAULT] CHARACTER SET charset_name]
[[DEFAULT] COLLATE collation_name]

ALTER DATABASE db_name
[[DEFAULT] CHARACTER SET charset_name]
[[DEFAULT] COLLATE collation_name]

http://dev.mysql.com/doc/refman/5.0/en/charset-database.html

HTH,

-t

Reply all
Reply to author
Forward
0 new messages