Configuration to control the creation of default data (#12122)

* Added configuration and checks for creation of default Umbraco data.

* Fixed configuration binding issues.

* Updated comments.

* Added DefaultDataCreationSettings to the JSON schema.

* Removed option to not install default relation types as Umbraco relies on (and will recreate) them if they aren't there.

* Renamed configuration class used for install of default data and converted to named optios.

* Fix to failing unit tests.

* Fixes for integration tests.

* Apply suggestions from code review

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>

* Further fix from code review.

* Updated naming as per PR review suggestions.

* Update src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
This commit is contained in:
Andy Butland
2022-03-25 08:58:07 +01:00
committed by GitHub
parent d0823d4236
commit 02e76c8227
15 changed files with 1000 additions and 247 deletions

View File

@@ -10,9 +10,11 @@ using System.Diagnostics;
using System.Linq;
using System.Threading;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Moq;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Infrastructure.Migrations.Install;
using Umbraco.Cms.Infrastructure.Persistence;
@@ -137,7 +139,7 @@ namespace Umbraco.Cms.Tests.Integration.Testing
using (NPoco.ITransaction transaction = database.GetTransaction())
{
var schemaCreator = new DatabaseSchemaCreator(database, _loggerFactory.CreateLogger<DatabaseSchemaCreator>(), _loggerFactory, new UmbracoVersion(), Mock.Of<IEventAggregator>());
var schemaCreator = new DatabaseSchemaCreator(database, _loggerFactory.CreateLogger<DatabaseSchemaCreator>(), _loggerFactory, new UmbracoVersion(), Mock.Of<IEventAggregator>(), Mock.Of<IOptionsMonitor<InstallDefaultDataSettings>>(x => x.CurrentValue == new InstallDefaultDataSettings()));
schemaCreator.InitializeDatabaseSchema();
transaction.Complete();