Commit Graph

43 Commits

Author SHA1 Message Date
Stephan
c76403077f Normalize cr/lf/tab 2017-07-20 11:21:28 +02:00
Stephan
49d54f497d Persistence reorg 2016-12-16 17:20:51 +01:00
Stephan
b26b415096 Merge origin/dev-v7-deploy into dev-v8-zbwip (builds) 2016-11-03 10:31:44 +01:00
Claus
7d0c92937a U4-8754 Single content queries like Get(int id) for content, media and members needs to execute a TOP 1 (or LIMIT 1)
updated a bunch of the remaining repositories to also use this pattern where applicable (repos using mappers aren't compatible without more work).
2016-08-02 12:11:35 +02:00
Stephan
ddf38407d8 U4-4847 Refactor ContentService (#1266)
* U4-4748 - refactor Content-, Media- and MemberTypeRepository

* Cleanup Attempt

* Cleanup OperationStatus

* U4-4748 - refactor Content-, Media- and MemberTypeService

* U4-4748 - cleanup locking

* U4-4748 - refactor Content-, Media- and MemberRepository

* U4-4748 - refactor ContentService (in progress)

* U4-4748 - all unit of work must be completed

* U4-4748 - refactor locks, fix tests

* U4-4748 - deal with fixmes

* U4-4748 - lock table migration

* Update UmbracoVersion

* Fix AuthorizeUpgrade

* U4-4748 - cleanup+bugfix lock objects

* U4-4748 - bugfix

* updates a string interpolation
2016-05-18 10:55:19 +02:00
Shannon
6124126835 Fixes the custom field sorting, no longer has a sub query for order by, now supports both mysql and sqlce, adds a unit test (should add more though) 2016-04-20 15:50:38 +02:00
Shannon
f149ca9c76 Fixes SqlCe and MySQL sorting on custom properties for list view, this also makes the query work much better and there is no longer a requirement for a sub-query in the order by statement. 2016-04-20 12:50:52 +02:00
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
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
Shannon
4f3968e837 R# cleanup, losts of obsoleted methods removed 2015-12-22 18:00: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
Stephan
583ae2df11 Bugfix 2015-09-15 10:52:32 +02:00
Stephan
14cd1e7a76 Bugfix SqlSyntaxProvider date formatting 2015-09-15 10:49:41 +02:00
Shannon
8d24ac3651 Oops, fixes PK creation logic for MySQL (had the wrong boolean) 2015-09-14 10:33:37 +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
Shannon
afacdc12ad More work on parameterized queries, all tests for repos passing now. 2014-09-24 16:59:45 +10:00
Shannon
00f86ffef7 More work on sql parameterization with sql expressions, lots of tests passing but a few fixes still required. Streamlines IQuery to actually have the correct method implementations so we're not casting everywhere. 2014-09-24 13:51:16 +10: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
2dd04799b2 WIP membership provider updates 2013-12-19 18:33:25 +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 Deminick
1b66c42c9b Fixes RePublishAll method to ensure it performs the same function as the legacy Document.RePublishAll - it just
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.
2013-03-19 23:46:13 +06: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
f3621aa743 MySQL: Check for case-sensitivity 2013-02-25 13:14:26 -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
Sebastiaan Janssen
55dbce3a93 Okay, really fixed the getdate() problem now. Maybe.. I should.. You know.. build my code first before I test it! D'oh. 2013-01-02 11:49:57 -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
Morten Christensen
213451e442 Implementing the MigrationRunner, which will be used for database upgrades.
Refactoring a few bits in the syntax of the migration models.
Adding an extension of the PluginManager to find migrations by Type and Attribute.
2012-11-30 18:48:20 -01:00
Morten Christensen
d05a8e0390 Creating DbTypeMap for formatting type in expression 2012-11-30 17:56:02 -01:00
Morten Christensen
f59f57fd6a Initial work on fluent database migrations 2012-11-30 15:01:52 -01:00
sitereactor
137a54b193 Refactoring DTOs for Identity seed, which is used by Sql Ce.
Updating unit tests and Contexts to include the ServiceContext and DatabaseContext.
2012-10-30 15:03:58 -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