silverstripe/silverstripe-mssql — pull request #5 by tractorcow (2012-09-24 04:09:52+00:00)
Title: FIXED: Repaired failing test cases (DataObjectSchemaGenerationTest)

This pull request is to fix the failing DataObjectSchemaGenerationTest tests for MS SQL Server.

This also includes a bunch of parsing robustness fixes that were originally designed for the postgres database connector module. Please check the following functions at https://github.com/silverstripe/silverstripe-postgresql/blob/master/code/PostgreSQLDatabase.php#L947 which have been pulled across, with only minor documentation updates:

* implodeColumnList
* explodeColumnString
* quoteColumnSpecString (depends on the above two functions)
* determineIndexType
* parseIndexSpec (depends on the above two functions)

The documentation of the parseIndexSpec function should explain succinctly the changes that this request makes: All index specification strings and/or arrays can be uniformly parsed, and then treated consistently by the rest of the application, rather than having conditionals scattered through the code for handling the various individual cases.

Having demonstrated the parsing structure in this and in the postgres model, I would like to propose that these above methods are refactored up into the SS_DataBase class to provide for a more robust framework for indexing databases.

This pull request also has some minor cleanup of code and fixes to the alterIndex function.