Commit Graph

125 Commits

Author SHA1 Message Date
Stephan
612c38654d Merge branch origin/dev-v7 into temp8 2018-09-06 13:07:09 +02:00
Shannon Deminick
a151829b26 Merge pull request #2845 from umbraco/temp8-serilog
Bye bye Log4Net, Hello Serilog
2018-08-28 20:31:12 +10:00
Sebastiaan Janssen
7fd1617759 Merge branch 'dev-v7' into validate-using-schema 2018-08-26 23:13:08 +02:00
Shannon
04db0caa63 Merge remote-tracking branch 'origin/dev-v7' into temp8
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
#	src/Umbraco.Core/Migrations/Install/DatabaseSchemaCreator.cs
#	src/Umbraco.Core/Migrations/Upgrade/V_7_12_0/AddRelationTypeForMediaFolderOnDelete.cs
#	src/Umbraco.Core/Migrations/Upgrade/V_7_12_0/IncreaseLanguageIsoCodeColumnLength.cs
#	src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ConstraintDefinition.cs
#	src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DbIndexDefinition.cs
#	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddIndexToCmsMacroPropertyTable.cs
#	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddIndexToCmsMacroTable.cs
#	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagsTable.cs
#	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AssignMissingKeysAndIndexes.cs
#	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenEightZero/AddIndexToPropertyTypeAliasColumn.cs
#	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddForeignKeysForLanguageAndDictionaryTables.cs
#	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/MigrateAndRemoveTemplateMasterColumn.cs
#	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/UpdateUniqueIdToHaveCorrectIndexType.cs
#	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/AddMissingForeignKeyForContentType.cs
#	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AdditionalIndexesAndKeys.cs
#	src/Umbraco.Core/Persistence/SqlSyntax/ISqlSyntaxProvider.cs
#	src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs
#	src/Umbraco.Core/Persistence/SqlSyntax/SqlCeSyntaxProvider.cs
#	src/Umbraco.Core/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs
#	src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs
#	src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderExtensions.cs
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.editor.html
#	src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/DatabaseSchemaValidationHealthCheck.cs
#	src/Umbraco.Web/Scheduling/KeepAlive.cs
#	src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs
2018-08-20 15:16:58 +10:00
Warren
9e996c68bb Refactored the error params, so that exception is before the message/template so its more in sync with Serilog signature & was an easy way to find some more logs I missed too 2018-08-17 15:41:58 +01:00
Shannon
9d75e36eb4 Ensures that checking for constraints/indexes is done within the transaction before dropping anything instead of before the transaction. 2018-08-17 15:20:12 +10:00
Shannon
5068b8ae9f Fixes DB schema validation 2018-08-17 11:16:10 +10:00
Shannon
cdf3581721 code simplification 2018-08-17 10:53:45 +10:00
Shannon
0c6cca44d8 Fixes SQL providers for returning the correct results for constraints 2018-08-17 10:53:21 +10:00
Stephan
c7c1c7e8fa Cleanup ISqlSyntaxProvider 2018-07-17 17:20:40 +02:00
Stephan
7a615133ff Renormalize 2018-06-29 19:52:40 +02:00
Morten Christensen
f5b017ed67 Updates sql to include current schema in queries 2018-06-08 10:44:11 +02:00
Stephan
9e1d19d56a Fix ALTER TABLE ADD COLUMN issue 2018-05-30 10:00:18 +02:00
Stephan
c6514a6ee1 Troubleshooting variants, running the back-office 2017-11-22 08:39:54 +01:00
Stephan
c1e2625de0 Use ISqlContext 2017-09-22 19:19:28 +02:00
Stephan
ab8fc33691 Port 7.7 - WIP 2017-08-14 18:21:48 +02:00
Stephan
c76403077f Normalize cr/lf/tab 2017-07-20 11:21:28 +02:00
Stephan
8561d85f7a porting 7.6-rc1 into 8 2017-05-24 12:25:39 +02:00
Shannon
2b82520067 U4-8998 umbracoRelation table needs unique index on columns: parentId, childId, relType 2017-02-10 15:38:53 +11:00
Stephan
49d54f497d Persistence reorg 2016-12-16 17:20:51 +01:00
Stephan
8e056aba66 Merge origin/dev-v7.6 into dev-v8-zbwip (builds, not tested) 2016-11-23 10:33:12 +01:00
Stephan
568a4987e3 U4-9195 - fix PetaPoco page of int 2016-11-16 17:51:00 +01:00
Stephan
467ed87c3b Ensure U4-8729 is properly merged into v8 2016-11-05 10:32:09 +01:00
Stephan
c6e4e3b3ed Merge origin/dev-v7-deploy into dev-v8-zbwip 2016-11-04 18:40:42 +01:00
Stephan
b26b415096 Merge origin/dev-v7-deploy into dev-v8-zbwip (builds) 2016-11-03 10:31:44 +01:00
Shannon
dadcbc8b31 U4-9107 Change BulkInsertRecords to use BulkCopy or TableDirect (SQLCE) 2016-10-25 12:29:17 +02:00
Shannon
d99a691bdc Changes magic strings to constants for database provider types. 2016-08-09 15:36:02 +02:00
Shannon
c1da28dd47 U4-8837 Change paging query for SQL server 2012+ to be more efficient 2016-08-09 15:33:35 +02: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
2481b77f03 U4-8729 - reviewing PR 2016-07-19 11:28:54 +02:00
Stephan
764f10327e Merge branch 'peta-poco-issues' of https://github.com/pynej/Umbraco-CMS into temp-u4-8729 2016-07-19 10:57:03 +02:00
Stephan
77c2766d55 Merge branch origin/dev-v7 into dev-v8 2016-07-18 14:42:06 +02:00
Jeremy Pyne
a40f87eb36 Fixed an issues with user generated PetaPoco's would not work if they included schema's.
Fixed an issue where strong typed helper methods would not generate valid SQL for column names if the poco didn't explicitly set a [Column(Name="")] attribute. The PetaPoco format allows for this though and will default to the property name.  Again this would cause issues for developers trying to use the DatabaseContext.Database class with their own Poco's.

Both the above causes would happen for example if using the PetaPoco T4 templates to automatically generate Poco's.
2016-07-14 17:01:51 -04:00
Shannon
52e2cbab90 updates delete query to work with MySql 2016-07-14 18:00:43 +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
2027cd7b07 Merge branch 'dev-v8' into dev-v8-persistclr
Conflicts:
	src/Umbraco.Core/Persistence/UmbracoDatabase.cs
	src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs
	src/Umbraco.Tests/Umbraco.Tests.csproj
2016-04-21 12:19:14 +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
Stephan
3b612bf346 Core.Persistence - more cleanup 2016-04-14 18:20:07 +02:00
Stephan
aceaf4b15d Core.Persistence - massive cleanup 2016-04-13 17:33:09 +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
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
Shannon
d37d31246e Merge remote-tracking branch 'origin/dev-v7' into dev-v8
Conflicts:
	src/Umbraco.Core/Persistence/Migrations/MigrationRunner.cs
	src/Umbraco.Core/Persistence/Querying/BaseExpressionHelper.cs
	src/Umbraco.Tests/Persistence/SyntaxProvider/MySqlSyntaxProviderTests.cs
	src/Umbraco.Web.UI/umbraco/create/content.ascx
	src/Umbraco.Web.UI/umbraco/create/member.ascx
	src/Umbraco.Web.UI/umbraco/create/nodeType.ascx
	src/Umbraco.Web/PropertyEditors/TrueFalsePropertyEditor.cs
	src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs
	src/Umbraco.Web/Security/Identity/BackOfficeCookieManager.cs
	src/Umbraco.Web/Strategies/Migrations/ClearMediaXmlCacheForDeletedItemsAfterUpgrade.cs
	src/Umbraco.Web/Strategies/Migrations/PublishAfterUpgradeToVersionSixth.cs
	src/Umbraco.Web/Umbraco.Web.csproj
	src/Umbraco.Web/WebBootManager.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs
2016-03-16 15:02:53 +01:00
Stephan
f1366c7d29 U4-8017 - fix issues with MySql InitColumnTypeMap 2016-02-19 13:33:11 +01:00
Shannon
4f3968e837 R# cleanup, losts of obsoleted methods removed 2015-12-22 18:00:11 +01:00