Original work done on https://github.com/umbraco/Umbraco-CMS/pull/711 but ported to the latest version
Content below for reference
With the current implementation of the list view you can only sort by system columns (Name, SortOrder etc.) and not custom columns you have added to your document types. This PR allows that.
The crux of it is a sub-query added to the ORDER BY clause when we are ordering by a custom field. This looks up the field's value from the most recent content version.
Provided here and not in the previous pull request is:
MySQL support
Have done some performance testing. On a local laptop with 1000 nodes in a list view, it's sorting in around 220-250ms. It's a little slower that sorting on native properties like node name, but still perfectly usable - there's no significant delay you see in use.
Please note also:
GetPagedResultsByQuery() in VersionableRepositoryBase was previously doing an ORDER BY in SQL and then repeating this via LINQ to Objects. I couldn't see that this second ordering was necessary so removed it, but wanted to flag here in case I've missed something around why this was necessary.
The PR also includes small amends to fix or hide sorting on a couple of the default columns for the member amd media list views.
The logic would produce incorrect syntax.
Fixed the default string column for sql server, made them all consistent.
Moved ctor logic for shared sql syntax providers to the base class.
Created formatted Decimal column definitions so that a custom precision/scale works.
Set the migration to use the default precision/scale values.
Removes the pattern validators because they don't do anything... due to the fix-number directive which has it's own issues but we won't solve those now.
* DateTime's during migrations are formatted in a very explicit way
* Migration's that need to execute multiple statements are fixed in SQLCE by splitting on GO
re-generates the XML in the cmsContentXml table. Updates the Sql providers to support truncate table. Updates the RepublishAll
unit test. Adds a TruncateTable extension to PetaPoco. Adds locking to certain service methods that perform more than once function.
Helps determine if valid database exists and which version it corresponds to.
On startup the legacy connectionstring is used if one exists, so its not ignore but rather reconfigured.
Relates to U4-1520.
Fixes regression bug from removing brackets from PrimaryKey columns. Columns are now passed and syntax specific brackets are added.
Moving the MySql special case for updating User Id from one to zero.
Refactoring the current sql syntax providers to better work with sql ce, sql server and mysql.
Adding migrations for v4.8 and v6.0.
Adding test cases for upgrading from 4.7 to 6.0 for the 3 database providers - sql ce, sql server and mysql.
Adding product name to the MigrationAttribute, which adds more flexibility to the MigrationRunner.
Fixing schema creation for mysql, which broke during a previous refactor task.