tdm00/cfwheels-dbmigrate-plugin — pull request #75 by jordanclark (2013-03-28 21:54:52+00:00)
Title: 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.