Commit Graph

42 Commits

Author SHA1 Message Date
Shannon
df016813ea Merge remote-tracking branch 'origin/dev-v7.5' into dev-v8
Conflicts:
	src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
	src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentRepository.cs
	src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaRepository.cs
	src/Umbraco.Core/Persistence/Repositories/MediaRepository.cs
	src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs
	src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBase.cs
	src/Umbraco.Core/Services/ContentService.cs
	src/Umbraco.Core/Services/MediaService.cs
	src/Umbraco.Core/Services/MemberService.cs
	src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs
	src/Umbraco.Web/Editors/AuthenticationController.cs
	src/Umbraco.Web/Editors/BackOfficeController.cs
	src/UmbracoExamine/UmbracoMemberIndexer.cs
	src/umbraco.businesslogic/UmbracoSettings.cs
2016-04-13 16:18:58 +02:00
Shannon
10bb16316d Updates sorting code to support decimals - need to test on MySql 2016-04-13 14:49:37 +02:00
Stephan
365a01a476 From PetaPoco to NPoco (#1207)
* NPoco - 2.x (builds)

* NPoco - v3.1 (does not build)

* NPoco - builds

* NPoco - configure database factory (tests fail)

* Pick fix from 7.4

* NPoco - stock v3.1 - sort-of working

* NPoco - fix merge

* Fix Newtonsoft.Json in web.Template.Debug.config

* NPoco - fix SELECT *

* NPoco - fixing repositories

* NPoco - fix EntityRepository

* NPoco - fix EntityRepository

* NPoco - cosmetic

* NPoco - use 3.1.0-u001 from github/zpqrtbnk/NPoco

* Fixes build, NPoco needed to be referenced in the cms and UmbracoExamine projects

* Fixes lots of tests

* fixes more tests

* NPoco - bugfixing

* Bugfix CacheHelper in tests

* Bugfix connection mocking in tests

* NPoco - inject database in Sql.Select<>

* NPoco - discovery retry policy only once

* Enable C# 6 for Umbraco.Core

* NPoco - introduce UmbracoSql, cleanup

* NPoco - more cleanup and fixing

* NPoco - fix UserRepository

* Optimize InGroupsOf

* Implement UmbracoDatabase.FetchByGroups

* NPoco - fix Select

* NPoco - simplify GetPagedResultsByQuery

* Cherry-pick DisableBrowserCacheAttribute fix from 7.4

* Upgrade NPoco to use Sql<TContext>

* U4-8257 - cleanup relators

* 4-8257 - cleanup more relators

* Upgrade NPoco with more OOTB version

* fixes a couple tests, changes double check lock to Lazy<T>
2016-04-12 15:11:07 +02:00
Shannon
90a66aeebd fixes merge / build 2016-04-05 16:32:46 +02:00
Shannon
c20984dca7 Merge branch 'dev-v7' of https://github.com/aadfPT/Umbraco-CMS into aadfPT-dev-v7
Conflicts:
	src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
	src/Umbraco.Core/Persistence/Repositories/MediaRepository.cs
	src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs
	src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBase.cs
	src/Umbraco.Core/Services/ContentService.cs
	src/Umbraco.Core/Services/IContentService.cs
	src/Umbraco.Core/Services/IMediaService.cs
	src/Umbraco.Core/Services/IMemberService.cs
	src/Umbraco.Core/Services/MediaService.cs
	src/Umbraco.Core/Services/MemberService.cs
	src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs
	src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs
	src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs
	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
	src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js
	src/Umbraco.Web.UI.Client/src/common/resources/member.resource.js
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
	src/Umbraco.Web/Editors/ContentController.cs
	src/Umbraco.Web/Editors/MediaController.cs
	src/Umbraco.Web/Editors/MemberController.cs
	src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs
	src/UmbracoExamine/UmbracoMemberIndexer.cs
2016-04-05 16:20:39 +02:00
Shannon
ef3f15ec9b Merge branch 'u4-6003b' of https://github.com/AndyButland/Umbraco-CMS into AndyButland-u4-6003b
Conflicts:
	src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
	src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentRepository.cs
	src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaRepository.cs
	src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberRepository.cs
	src/Umbraco.Core/Persistence/Repositories/MediaRepository.cs
	src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs
	src/Umbraco.Core/Services/ContentService.cs
	src/Umbraco.Core/Services/IContentService.cs
	src/Umbraco.Core/Services/IMediaService.cs
	src/Umbraco.Core/Services/IMemberService.cs
	src/Umbraco.Core/Services/MediaService.cs
	src/Umbraco.Core/Services/MemberService.cs
	src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs
	src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs
	src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html
	src/Umbraco.Web/Editors/MemberController.cs
	src/UmbracoExamine/UmbracoMemberIndexer.cs
2016-04-05 15:31:33 +02:00
André Ferreira
bd2a40d214 U4-6003 List View - Order By Custom Property Fix
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.
2016-04-01 11:28:51 +01:00
Stephan
f1366c7d29 U4-8017 - fix issues with MySql InitColumnTypeMap 2016-02-19 13:33:11 +01:00
Shannon
327a00aaf4 Fixes issue with migrations running with a Decimal column:
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.
2015-10-14 12:07:50 +02:00
Shannon
7beb21ad66 Fixes upgrade issues with MySql, along with a few other things:
* All usages of getdate() are changed to the system value
* All usages of newid() are chagned to the system value
* Removes the hacks associated with the above
* Fixes the fluent migrations for table creation for mysql to not double create a PK
* Removes other system field values that actually don't do anthing and shouldn't be used
2015-09-11 17:49:47 +02:00
Shannon
488ba05eda Fixes upgrade issues with SQLCE and DateTime:
* 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
2015-09-11 13:55:13 +02:00
Shannon
4bb89c1827 Fixes: U4-7090 Upgrade error with dates 2015-09-11 11:49:37 +02:00
AndyButland
a1ae0f70bb Moved custom column list view order by sql variations into syntax providers 2015-06-12 09:15:36 +02:00
Shannon
9f30a9b0fc Removes more singletons and reliance on singletons/statics 2015-01-09 12:04:33 +11:00
Shannon
e1a134f587 Fixes: U4-4430 MySql primary key issues 2014-03-14 17:11:21 +11:00
Shannon
bbe6194b06 Exception is thrown if trying to run mysql in med trust. Migrations arranged to execute schema migrations first and then data migrations. If a schema migration fails it will attempt to run the downgrade scripts of the migrations if running mysql since schema changes aren't supported in transactions. Updated all sql syntax providers to try to return only the column indexes, not key indexes. Updates the db version checker to include errors for all missing columns, indexes and constraints in the db and vice versa in the schema. 2014-03-14 13:04:20 +11:00
Shannon
e020989577 Give some love to mysql with regards to schema validation and the syntax provider - need ignore case comparisons. 2014-03-13 20:42:57 +11:00
Shannon
aee10348e5 Ensures not to add new indexes if they already exist 2014-03-12 18:37:22 +11:00
Shannon
3a92c26a7f Adds ability to extract index details from databases using sql syntax provider. 2014-03-12 17:17:52 +11:00
Shannon
e0dcc3afbc Streamlines how strings are escaped with the sql expression helpers and syntax providers. Fixes: U4-4232 Umbraco.Core.Persistence.Querying issue with backslashes 2014-02-17 21:38:13 +11:00
Shannon
a21aa079ff Adds ability to use the query builder with string matches based on an NText column 2013-12-18 17:22:00 +11:00
Shannon
4cb4ff0617 Fix MySQL migrations.
Conflicts:
	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagRelationsTable.cs
2013-12-06 10:26:32 +11:00
Sebastiaan Janssen
a1037ce43c Fixes U4-2187 - Enable support for MySQL on Linux 2013-07-23 15:38:26 +02:00
Morten Christensen
928d92fce4 Making the Sql Syntax Providers public and changing a few names and bits for consistency.
Adding resolver for the syntax providers and wiring it up in the boot manager.
2013-03-09 10:43:34 -01:00
Sebastiaan Janssen
560dcad90a Updates for MySQL: Check for case-sensitivity 2013-02-25 14:42:07 -01:00
Sebastiaan Janssen
f3621aa743 MySQL: Check for case-sensitivity 2013-02-25 13:14:26 -01:00
Sebastiaan@SEBVIRTUAL.SSG5-Serial
5dc80c55b2 Fixed some issues with the mysql syntax provider 2013-01-29 12:55:55 -01:00
Morten Christensen
5d0aced9a7 Giving the install/upgrade a bit of TLC.
Fixes U4-1520
2013-01-28 14:01:38 -01:00
Morten Christensen
7aabf459ea Adding schema validation to the DatabaseSchemaCreation class.
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.
2013-01-25 15:05:42 -01:00
Morten Christensen
b5a140945a Fixes U4-1479 by adding .ToList() to allowed templates, which ensures that the list is fetched from the database while the connection is still open.
Fixing typo in usage of LogHelper in PhysicalFileSystem.
Ensures connection is closed after using TableExists for MySql.
Adds logging to UmbracoDatabase.
2013-01-18 09:00:18 -01:00
Sebastiaan Janssen
01fa4bdc78 Fix badly formated "getdate()" default value (CE didn't like it) 2013-01-02 11:33:56 -01:00
Morten Christensen
e4e5982349 Removing sql server/ce specific brackets from repository queries as it was causing problems with MySql.
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.
2012-12-27 19:53:01 -01:00
Morten Christensen
64af0a610b Refactoring migrations by adding an abstract class to all expressions that allow for processing prior to returning an sql statement.
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.
2012-12-27 18:52:47 -01:00
Morten Christensen
dbce36b7a5 Adding migrations for v6 upgrades.
Updating and testing migrations.
2012-12-26 14:44:42 -01:00
Morten Christensen
c1695c2f7f Updating expressions to output sql for use with the fluent migrations, so it can be used for db upgrades. 2012-12-20 11:36:20 -01:00
Morten Christensen
2ea3fe624f Refactoring SqlSyntaProvider to use the new common definitions. 2012-12-19 15:23:05 -01:00
Morten Christensen
736fbc6659 Moving database definition models, so they are shared and can be used in the sql syntax provider. 2012-12-07 13:48:38 -01:00
Sebastiaan Janssen
6a92b400b8 Open connection before checking if table exists 2012-12-05 14:43:37 -01:00
Morten Christensen
f59f57fd6a Initial work on fluent database migrations 2012-11-30 15:01:52 -01:00
sitereactor
ee96ced595 Adding missing code comments/documentation 2012-10-23 08:09:01 -02:00
sitereactor
b3d8b4c53c Refactoring syntax providers for db creation.
Adding tests for sql, sql ce and mysql to ensure the creaion of tables and their dependencies/references.
2012-10-19 19:07:17 -02:00
sitereactor
c1909eccf5 Refactoring database creation, adding sql syntax provider to account for differences in syntax between sql, ce and mysql.
Adding MySql unit test.
2012-10-19 13:20:57 -02:00