cfwheels-dbmigrate-plugin
cfwheels-dbmigrate-plugin copied to clipboard
Support more datatypes & better identity_insert
Added new limit options for integers, dates, & money (maps to decimal on non-mssql db) handy new methods mediumInteger(), smallInteger(), tinyInteger()
adds support for MSSQL: DATE, SMALLDATETIME, MONEY, SMALLMONEY, BIGINT, SMALLINT, TINYINT
adds support for mysql: BIGINT UNSIGNED, BIGINT, INT UNSIGNED, MEDIUMINT UNSIGNED, MEDIUMINT, SMALLINT UNSIGNED, SMALLINT, TINYINT UNSIGNED, TINYINT
Improve the IDENTITY_INSERT feature added for SQL Server.
I've moved building SQL INSERT into the abstract adapter, this way the custom adapters can extend the code if necessary instead of just a prefix/suffix method.
For the Microsoft SQL adapter I check if any column being inserted into is an IDENTITY column, and then wrap the IDENTITY_INSERT code when necessary, before it would only work if your identity column happened to be named "id".
I also improved the $getColumnDefinition function which wasn't using the "pattern" argument to only return a single column instead of the whole database.
@jordanclark thanks for this substantial contribution. I'll make some time to merge the diff into a new topic branch to test. Would you have any migration files that you could share to help test this functionality? I'm trying to create a set of these to test each change that I implement as it's the only way I've found to do testing. If you could add them to the tests folder push back up here they should be added to this merge request
You were correct the latest changes are part of the pull request, I'm a git-noob but at least I'm learning.
Here are 3 test migrations, I hope that helps.
Jordan,
Please don't apologize, even though I've been using Git for two years I'm constantly learning new things myself. Try a "git add -p" sometime to see the latest thing I've learned. In addition to that Github does a few things beyond what Git does by itself, such as pull-requests and how they're updated, again no apology needed. Thank you for these contributions and I hope to get them included this week.
On Sun, Mar 31, 2013 at 10:46 PM, jordanclark [email protected]:
You were correct the latest changes are part of the pull request, I'm a git-noob but at least I'm learning.
Here are 3 test migrations, I hope that helps.
— Reply to this email directly or view it on GitHubhttps://github.com/tdm00/cfwheels-dbmigrate-plugin/pull/75#issuecomment-15702407 .
Troy Murray
@jordanclark I haven't forgotten about this pull request. I tried merging it with a new topic branch last week and it broke the plugins ability to load the migrations. I'm working on trying to find out why as it must be working for you.
@tdm00 Troy sorry about that bug, I also created a fix for railo 4 and createObjectFromRoot and incorrectly transfered the code into the plugin. It should be working correctly now.
Jordan,
I tried merging this after you sent it and the plugin stopped working. I haven't been able to track it own, or rather had the time. I'll give this a try, thanks for letting me know.
On Friday, April 26, 2013, jordanclark wrote:
@tdm00 https://github.com/tdm00 Troy sorry about that bug, I also created a fix for railo 4 and createObjectFromRoot and incorrectly transfered the code into the plugin. It should be working correctly now.
— Reply to this email directly or view it on GitHubhttps://github.com/tdm00/cfwheels-dbmigrate-plugin/pull/75#issuecomment-17091823 .
Troy Murray
Ping?
Jordan,
The last time I tried the merge on the master branch it still wasn't producing an error that I haven't been able to track down.
On Thu, Jul 4, 2013 at 6:46 PM, jordanclark [email protected]:
Ping?
— Reply to this email directly or view it on GitHubhttps://github.com/tdm00/cfwheels-dbmigrate-plugin/pull/75#issuecomment-20495618 .
Troy Murray
I have been using my updated version of the plugin without a problem for months. I did just fix a little bug I caused in the MicrosoftSQLServer adapter, but I don't think that would have affected you.
Were you using it with Railo? Because there is an unrelated bug in the latest version of Railo that is still incompatible with CFWheels, a patch I submitted to the wheels team hasn't gone anywhere either, but I applied the same fix to dbmigrate's copy of $createObjectFromRoot, but now it checks wheel's version number so it shouldn't break previous builds.
Maybe give it another shot?
Jordan
On Thu, Jul 4, 2013 at 3:51 PM, Troy Murray [email protected]:
Jordan,
The last time I tried the merge on the master branch it still wasn't producing an error that I haven't been able to track down.
On Thu, Jul 4, 2013 at 6:46 PM, jordanclark [email protected]:
Ping?
— Reply to this email directly or view it on GitHub< https://github.com/tdm00/cfwheels-dbmigrate-plugin/pull/75#issuecomment-20495618>
.
Troy Murray
— Reply to this email directly or view it on GitHubhttps://github.com/tdm00/cfwheels-dbmigrate-plugin/pull/75#issuecomment-20495691 .
Sure, I'll give it a try tonight.
On Friday, July 5, 2013, jordanclark wrote:
I have been using my updated version of the plugin without a problem for months. I did just fix a little bug I caused in the MicrosoftSQLServer adapter, but I don't think that would have affected you.
Were you using it with Railo? Because there is an unrelated bug in the latest version of Railo that is still incompatible with CFWheels, a patch I submitted to the wheels team hasn't gone anywhere either, but I applied the same fix to dbmigrate's copy of $createObjectFromRoot, but now it checks wheel's version number so it shouldn't break previous builds.
Maybe give it another shot?
Jordan
On Thu, Jul 4, 2013 at 3:51 PM, Troy Murray <[email protected]<javascript:_e({}, 'cvml', '[email protected]');>>wrote:
Jordan,
The last time I tried the merge on the master branch it still wasn't producing an error that I haven't been able to track down.
On Thu, Jul 4, 2013 at 6:46 PM, jordanclark <[email protected]<javascript:_e({}, 'cvml', '[email protected]');>>wrote:
Ping?
— Reply to this email directly or view it on GitHub<
https://github.com/tdm00/cfwheels-dbmigrate-plugin/pull/75#issuecomment-20495618>
.
Troy Murray
— Reply to this email directly or view it on GitHub< https://github.com/tdm00/cfwheels-dbmigrate-plugin/pull/75#issuecomment-20495691>
.
— Reply to this email directly or view it on GitHubhttps://github.com/tdm00/cfwheels-dbmigrate-plugin/pull/75#issuecomment-20532787 .
Troy Murray