cfwheels-dbmigrate-plugin
cfwheels-dbmigrate-plugin copied to clipboard
Allow creation of composite keys
When creating a join table, it would be great if I could do this.
t = createTable(name='taggings',primaryKey='tagid,articleid'); t.integer('tagid'); t.integer('articleid'); t.timestamps(); t.create();
thanks
Checkout what Chris Peters did for this as posted at https://github.com/clearcrystalmedia/Administrivia/blob/master/db/migrate/Migration.cfc
I'm wondering if this needs to be coded this way, or if it's possible to just use the execute() command to do the same, although that does require SQL specific code.
It could have been coded using execute()
, but I wasn't aware of the function's existence when I wrote that CFC. (Or I simply forgot about it.)
I really like your syntax in the description above. It matches what the Rails composite_migrations plugin does: http://errtheblog.com/posts/14-composite-migrations
I agree that I prefer the syntax above. In the meantime, using the execute() function works until I can add this:
Example: