Compare commits

...
Author SHA1 Message Date
05353f3925 EF Core: Migrate content type repository to EF core (#23160)
* add needed dtos

* Migrate repository to ef core

* Finish up everything, so no NPoco

* regenerate migrations

* merge into one file

* Touch scope before going async

* convert to byte and short to int so it works on SQLServer

* add extra test

* revert to private

* Add async base we can derive from, to be used for members and media too

* Rename to non ef core names

* actually use async

* actually use async

* Remove unused usings

* Add actualy async interface

* fix retry strategy

* Update src/Umbraco.Infrastructure/Persistence/Repositories/Implement/EFCore/AsyncContentTypeRepositoryBase.cs

Co-authored-by: Andy Butland <abutland73@gmail.com>

* Fix n1 query and batch saving

* Dont clear change tracking

* remove non-changing properties

* fix comments

* convert to lambda

* add invidivual pragma warning to prevent hiding potential new sql injections

* quto tables for postgress

* Split factories to just have the EFCore ones in one

* add clear back with specific comment

* Fix tests

* add todo comments

* remove async GetByQuery

* Add TODO

* Fix ContentTypeConfiguration

* Fix migration

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2026-06-25 15:02:57 +09:00
NillasKA b200dfc55c Adjusting usages messed up in merge from main 2026-06-05 09:44:48 +02:00
NillasKA b2167b8fc2 Merge branch 'main' into v18/feature/ef-core-repositories
# Conflicts:
#	src/Umbraco.Cms.Persistence.EFCore.Sqlite/CLAUDE.md
#	src/Umbraco.Cms.Persistence.EFCore.Sqlite/SqliteMigrationProviderSetup.cs
#	src/Umbraco.Infrastructure/Persistence/EFCore/SqliteExceptionExtensions.cs
2026-06-05 09:38:27 +02:00
Nicklas KramerandGitHub 4247596877 EF Core: Migrating Dictionary Repository to EF Core (#22327)
* DTOs created

* Repository and factory migrated

* Finalizing migration

* Fine tuning some repository stuff

* Create integration test for decendants

* Various changes in accordance to CR

* Re-doing dtos to have better naming

* Redoing migration due to dto change

* Improvements in accordance to CR

* Introducing AsyncDictionaryItemKeyCachePolicy and fixing recursive delete

* Redoing migration due to merge mess

* EFCore Migration again

* Cleaning up some delete logic

* Updating correctly rather than upsert. And adding a step to remove translation not not provided by the caller

* Renaming method

* Redoing migrations and solving merge conflicts
2026-06-04 14:24:44 +02:00
Nicklas KramerandGitHub 5242a9ccb7 EF Core: Migrating Id Key Map Repository (#22791)
* Repository migrated

* IdKeyMap.cs async changes.

* A ton of usages adjusted to await or .GetAwaiter().GetResult()

* Tests adjusted

* Fixing up failing unit test

* Cast nullable type to ensure FirstOrDefault can return null, rather than default.

* Changes in accordance to code review

* Changes to adhere to code review

* Changes in accordance to CR

* Usages in src adjusted

* test usages adjusted
2026-06-03 12:11:31 +02:00
Nicklas KramerandGitHub 2ed8bc3a21 EF Core: Migrating Consent Repository (#22541)
* DTO Created

* Migrating repository and factory

* Service adjusted and migrated

* Migrated tests

* Migration

* Changes in accordance to code review

* Changed to adhere to code review + replacing == with is keyword.

* Fixing up migrations after merge conflict

* Fixing merge conflicts and migrations
2026-06-02 21:06:59 +02:00
Nicklas KramerandGitHub c33f574de5 EFCore: Migrating Distributed Job Repository (#22378)
* EFCore DTO Created

* Migrating repository and service to EFCore and async

* Slight logic improvement in DistributedJobRepository.cs

* Migration commands run

* Final migration

* Fixing migrations

* Fixing int>short conversion bug and redoing migrations
2026-06-02 13:52:20 +02:00
37ebdbdc27 EFCore: Add content version cleanup policy dto (#23002)
* Migrate dto

* add missing DTO

* Add back unintentionally removed method

---------

Co-authored-by: Nicklas Kramer <kramernicklas@gmail.com>
2026-06-02 09:51:47 +09:00
NillasKA 057d86a469 Merge remote-tracking branch 'origin/main' into v18/feature/ef-core-repositories
# Conflicts:
#	src/Umbraco.Web.UI.Login/package-lock.json
2026-06-01 13:14:11 +02:00
5d11d13fe5 Task: Add umb-ef-core-empty-migration Claude skill (#23006)
* task(claude): add ef-core-empty-migration skill

Adds a Claude Code skill that automates the full workflow for generating
empty EF Core migration stubs when migrating NPoco repositories to EF Core.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* task(claude): address PR review feedback on ef-core-empty-migration skill

- Derive target version directory dynamically from version.json (major+1)
  instead of hardcoding V_19_0_0
- Fix prerequisite wording: Steps 1-3 are required, Step 4 is optional
- Replace uuidgen with cross-platform python3 UUID generation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* task(claude): revert to hardcoded V_19_0_0 version directory

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Changes based on feedback

* Minor update

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 13:23:15 +02:00
Nicklas KramerandGitHub cb6e1c47b9 EF Core: Migrating Public Access Repository (#22926)
* DTOs created

* Repository and Service migrated

* Adjust direct usages to async

* Adjusting usages

* Repository Interface changes

* Service interface adjusted

* Unit and Integration Tests adjusted

* Fixing up minor mistakes causing stack overflow error

* Migration completed

* Changes in accordance to code review

* Fixing broken migrations due to conflict

* Fixing typo

* Clearing migrations
2026-05-28 17:53:29 +02:00
mole a66d7b2a0d Merge remote-tracking branch 'origin/main' into v18/feature/ef-core-repositories 2026-05-26 13:06:56 +02:00
mole fac4a1606f Fix merge 2026-05-26 13:05:58 +02:00
mole 8f55d7dc38 Merge remote-tracking branch 'origin/main' into v18/feature/ef-core-repositories
# Conflicts:
#	Directory.Packages.props
#	src/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs
#	src/Umbraco.Core/DynamicRoot/Origin/SiteDynamicRootOriginFinder.cs
#	src/Umbraco.Core/Events/AddDomainWarningsWhenPublishingNotificationHandler.cs
#	src/Umbraco.Core/Services/DocumentUrlAliasService.cs
#	src/Umbraco.Core/Services/DocumentUrlService.cs
#	src/Umbraco.Core/Services/DomainService.cs
#	src/Umbraco.Core/Services/IDomainService.cs
#	src/Umbraco.Core/Services/ILocalizationService.cs
#	src/Umbraco.Core/Services/LocalizationService.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddEditorUiToDataType.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/RebuildDocumentUrls.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_4_0/AddRelationTypeForMembers.cs
#	src/Umbraco.Infrastructure/Persistence/EFCore/EFCoreCreateTablesNotificationHandler.cs
#	src/Umbraco.Infrastructure/Persistence/EFCore/Scoping/EFCoreScope.cs
#	src/Umbraco.Infrastructure/Persistence/EFCore/Scoping/EFCoreScopeConfiguration.cs
#	src/Umbraco.Infrastructure/Persistence/Relations/ContentRelationsUpdate.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentRepositoryBase.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DomainRepository.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/RelationTypeRepository.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RelationRepositoryTest.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaEditingServiceTests.MoveToRecycleBin.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RelationServiceTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/UrlAndDomains/DomainAndUrlsTests.cs
2026-05-26 10:45:40 +02:00
8f540009a8 EFCore: Relation repository (#22809)
* Add RelationDtos

* Start implementing repositories

* Fix the tests

* Migrate RelationTypeRepository.cs

* Add missing scope completions

* Swap usages in services

* Add obsolete comment

* Remove defaults

* Remove non async surface

* Fix to key

* Apply feedback from review

* Fix missing asyncs

* Remove dto usage

* Remove obsolete

* Rename to id

* QA: Stabilise rollback content versioning E2E test (#22975)

* Stabilise rollback E2E test by waiting for document reload before asserting.

* Condense rollback wait comment per code-review feedback.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Addressed code review feedback.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

(cherry picked from commit 51d70877d1)

* Revert "QA: Stabilise rollback content versioning E2E test (#22975)"

This reverts commit d1dc9af2fa.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2026-05-26 14:14:42 +09:00
Nicklas KramerandGitHub 6209d0b793 EF Core: Migrating Long Running Operation Repository (#22856)
* DTO Created

* Repository and service migrated

* Tests adjusted

* Migrations completed

* Fixing errors leading to failing integration tests

* Changes in accordance to CR
2026-05-23 20:15:26 +09:00
Nicklas KramerandGitHub a4dc083d7b EF Core: Migrating the Audit Repository (#22643)
* LogDto created

* Repository and factory. Subject to change

* Slight changes to repository

* Service migrated

* Tests migrated and adjusted

* Migration completed

* Revert "Migration completed"

This reverts commit ddf983b5c5.

* Adding user DTO for FK purposes. And Extending scope to include AuditEntry, so adding AuditEntryDTO

* AuditEntry repository and service migrated.

* Audit entry unit and integration tests adjusted

* Migration completed

* Changes in accordance to code review. Implementing BigSkip for long parameters.

* Moving extensions to correct namespace and directory
2026-05-06 13:20:22 +09:00
nikolajlauridsen 416f4bd33b Merge branch 'v18/dev' into v18/feature/ef-core-repositories
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_17_3_0/OptimizeInvariantUrlRecords.cs
2026-04-10 09:33:03 +02:00
mole 44b54f3171 Post merge fix 2026-04-09 13:36:59 +02:00
mole 69171d2044 Merge branch 'v18/dev' into v18/feature/ef-core-repositories
# Conflicts:
#	Directory.Packages.props
#	src/Umbraco.Cms.Persistence.EFCore/CLAUDE.md
#	src/Umbraco.Cms.Persistence.EFCore/EfCoreMigrationExecutor.cs
#	src/Umbraco.Cms.Persistence.EFCore/Scoping/EFCoreScopeAccessor.cs
#	src/Umbraco.Cms.Persistence.EFCore/Scoping/IAmbientEfCoreScopeStack.cs
#	src/Umbraco.Cms.Persistence.EFCore/Scoping/IEFCoreScopeAccessor.cs
#	src/Umbraco.Infrastructure/Persistence/EFCore/EFCoreCreateTablesNotificationHandler.cs
#	src/Umbraco.Infrastructure/Persistence/EFCore/EFCoreMigrationExecutor.cs
#	src/Umbraco.Infrastructure/Persistence/EFCore/EfCoreMigrationExecutor.cs
#	src/Umbraco.Infrastructure/Persistence/EFCore/Scoping/AmbientEFCoreScopeStack.cs
#	src/Umbraco.Infrastructure/Persistence/EFCore/Scoping/EFCoreScopeProvider.cs
#	src/Umbraco.Infrastructure/Persistence/EFCore/Scoping/IAmbientEFCoreScopeStack.cs
#	src/Umbraco.Infrastructure/Persistence/EFCore/Scoping/IAmbientEfCoreScopeStack.cs
#	src/Umbraco.Infrastructure/Persistence/EFCore/Scoping/IEFCoreScopeProvider.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/UrlAndDomains/DomainAndUrlsTests.cs
2026-04-09 13:20:04 +02:00
9adc6cccb9 EF Core: Migrating domain repository (#22283)
* Initial migration and Dto Creaton

* Migrating Domain Repository and Service to EFCore

* Finishing up migrations

* Taking care of tests and usages

* Handling selecting from nodeDto differently to avoid grabbing all columns

* Changes in accordance to CR

* Use constant

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
2026-04-09 10:32:12 +02:00
Nicklas KramerandGitHub 29552205f6 EFCore: Renaming TId to TKey for consistency. (#22253)
Renaming TId to TKey, renaming params and finally renaming comments to Key/Keys
2026-03-25 13:43:11 +01:00
mole 6e86027312 Merge branch 'v18/dev' into v18/feature/ef-core-repositories 2026-03-25 11:27:42 +01:00
mole 7884ea5a61 Fix merge 2026-03-25 11:08:54 +01:00
mole 7020d95966 Merge branch 'v18/dev' into v18/feature/ef-core-repositories
# Conflicts:
#	Directory.Packages.props
#	src/Umbraco.Core/Services/ILocalizationService.cs
#	src/Umbraco.Core/Services/LocalizationService.cs
#	src/Umbraco.Infrastructure/Installer/Steps/DatabaseUpgradeStep.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddEditorUiToDataType.cs
#	src/Umbraco.Infrastructure/Persistence/EFCore/Scoping/EFCoreScope.cs
#	src/Umbraco.Infrastructure/Persistence/Factories/PropertyFactory.cs
#	src/Umbraco.Infrastructure/Persistence/Factories/WebhookFactory.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/KeyValueRepository.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/LanguageRepository.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/LanguageRepositoryExtensions.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/LastSyncedRepository.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/WebhookRepository.cs
#	src/Umbraco.Infrastructure/Telemetry/Services/UsageInformationService.cs
2026-03-25 10:18:23 +01:00
Nicklas KramerandGitHub 3618e9d122 EF Core: Migrating LanguageRepository to EF Core (#22035)
* Small groundwork done, switching to another task due to blocker

* Create intial DTO

* Migrate LanguageRepository.cs to EFCore

* Convert LanguageRepositoryTest.cs to use new async repository and EFCore db.

* Adjusting service to migrated repository and adding GetAll

* Adjusting usages to fit new pattern

* Removing obsoleted class with usages

* Remove reminant of LocalizationService

* Creating AsyncRepositoryService.cs using new scope

* Revert "Remove reminant of LocalizationService"

This reverts commit 95bf14c9f0.

* Revert "Removing obsoleted class with usages"

This reverts commit ac482924e6.

* Migration

* Adjusting scope logic

* Changing parameter in LanguageFactory.cs

* Rebuilding code and id maps on GetAll

* Adjusting services

* Adjusting tests

* Changes to how we invoke code id map. Ensuring scope isnt accessed if not needed.

* Fixing minor issues causing failing tests

* Fixing migration and primitives

* Fixing minor issues

* Adjusting issues that failed tests

* Small fixes to tests and logic

* Slight fix to make bridged scopes work in async contexts

* Corrections in accordance to Copilots CR

* Migrating to key usage and creating temporary helpers to ease the migration

* Creating proper migrations to include new column

* Adjusting code in accordance to copilot review

* Changes in accordance to code review

* Scope adjustments
2026-03-25 09:01:20 +01:00
af60ac83c4 EF Core: Improved Claude support and various cleanup (#22143)
* Simplify IEFCoreModelCustomizer

* Add Collation model customizer to ensure consistent case handling when tables are created with EF Core

* Add claude EF Core DTO Migration Guide

* Update EF Core CLAUDE.md files to reflect SqliteCollationModelCustomizer and improve discoverability

- Update SQLite provider docs: collation is now handled automatically by
  SqliteCollationModelCustomizer (no per-DTO action needed)
- Add SqliteCollationModelCustomizer to folder structure and quick reference
- Inline migration commands in provider CLAUDE.md files (no longer requires
  jumping to Infrastructure Section 12 for the command)
- Add Section 12 pointers in Infrastructure CLAUDE.md project structure and
  Section 11 so EF Core migration work is easy to find
- Add ordering prerequisite warning in Step 5: Steps 1-3 must be complete
  before generating migrations or the snapshot silently misses the DTO
- Make snapshot verification concrete: search for table name constant to
  confirm EF Core discovered the DTO

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix bug where we called GetAll isntead of GetMany in async entity repository base

* Fix indentation

* Add tests for full dataset cache policy

* Ensure the correct locking mechanism is chosen

* Add tests

* Add pattern to allow IEFCoreModelCustomizer to be provider specific

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 09:31:54 +01:00
Nicklas KramerandGitHub 61fe538747 EF Core: Adding bridged scopes to support NPoco in EF Core repositories (#22098)
* Small groundwork done, switching to another task due to blocker

* Create intial DTO

* Migrate LanguageRepository.cs to EFCore

* Convert LanguageRepositoryTest.cs to use new async repository and EFCore db.

* Adjusting service to migrated repository and adding GetAll

* Adjusting usages to fit new pattern

* Removing obsoleted class with usages

* Remove reminant of LocalizationService

* Creating AsyncRepositoryService.cs using new scope

* Revert "Remove reminant of LocalizationService"

This reverts commit 95bf14c9f0.

* Revert "Removing obsoleted class with usages"

This reverts commit ac482924e6.

* Migration

* Adjusting scope logic

* Changing parameter in LanguageFactory.cs

* Rebuilding code and id maps on GetAll

* Adjusting services

* Adjusting tests

* Changes to how we invoke code id map. Ensuring scope isnt accessed if not needed.

* Fixing minor issues causing failing tests

* Fixing migration and primitives

* Fixing minor issues

* Adjusting issues that failed tests

* Creating bridged scopes to support NPoco in EF Core Repositories

* Revert "Adjusting issues that failed tests"

This reverts commit 184ba6e10a.

* Revert "Fixing minor issues"

This reverts commit 9d5a00fe47.

* Revert "Fixing migration and primitives"

This reverts commit 27cc37b48b.

* Revert "Fixing minor issues causing failing tests"

This reverts commit ebe816283f.

* Revert "Changes to how we invoke code id map. Ensuring scope isnt accessed if not needed."

This reverts commit 5cb0f4a5bf.

* Revert "Adjusting tests"

This reverts commit ba960a2612.

* Revert "Adjusting services"

This reverts commit 26a86bf3bf.

* Revert "Rebuilding code and id maps on GetAll"

This reverts commit 949c4d51ae.

* Revert "Changing parameter in LanguageFactory.cs"

This reverts commit ee737841e3.

* Revert "Adjusting scope logic"

This reverts commit beeeacd4f3.

* Revert "Migration"

This reverts commit 0fbc0b7e75.

* Reapply "Removing obsoleted class with usages"

This reverts commit 5747f0c33a.

* Reapply "Remove reminant of LocalizationService"

This reverts commit a202259e41.

* Revert "Creating AsyncRepositoryService.cs using new scope"

This reverts commit bad307b3b9.

* Revert "Remove reminant of LocalizationService"

This reverts commit 95bf14c9f0.

* Revert "Removing obsoleted class with usages"

This reverts commit ac482924e6.

* Revert "Adjusting usages to fit new pattern"

This reverts commit c93a374ac1.

* Revert "Adjusting service to migrated repository and adding GetAll"

This reverts commit 07bd2db5dd.

* Revert "Convert LanguageRepositoryTest.cs to use new async repository and EFCore db."

This reverts commit 679db59322.

* Revert "Migrate LanguageRepository.cs to EFCore"

This reverts commit 1e20fdc4d3.

* Revert "Create intial DTO"

This reverts commit 9c467d6eb7.

* Revert "Small groundwork done, switching to another task due to blocker"

This reverts commit 4e618cba

* Enlisting scope and redoing cleanup

* Adding tests and changing get and create ambient scope logic
2026-03-18 10:30:11 +01:00
9216e01e64 EF Core: Migrating KeyValueRepository (#21925)
* Moving files

* Creating dto

* Migrating repository

* Migrating Service and updating repository

* Updating usages to adhere to migrated service

* Using upsert in the repo

* Adjusting tests to fit new pattern

* Switching ScopeProvider in KeyValueService.cs

* Adding migrations

* Changes reflecting the code review

* Fixing failing integration tests

* Adhering to code review

* Fixing migration

* Regenerating migration because playwright was acting up

* Making migration no-op

* Append async to BackOfficeExternalLoginProviders

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
2026-03-04 09:10:48 +01:00
f70786505e EF Core: Implement AsyncFullDataSetRepositoryCachePolicy (#21901)
* Move Async repositories to the correct folders

* Implement AsyncFullDataSetRepositoryCachePolicy

* Undo template repository change

* Fix AsyncNoCacheRepositoryCachePolicy

* Fix merge

* Apply suggestions from code review

Co-authored-by: Andy Butland <abutland73@gmail.com>

* Update src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TemplateRepository.cs

Co-authored-by: Andy Butland <abutland73@gmail.com>

* Add TODO

* fix(infrastructure): use FindExtension<T> instead of FirstOrDefault cast in UmbracoDbContext

Options.Extensions iteration order is not guaranteed. Using FindExtension<CoreOptionsExtension>()
is the correct EF Core API for retrieving a specific options extension by type. The previous
FirstOrDefault() cast silently returned null when CoreOptionsExtension was not first in the
dictionary, causing fallback to StaticServiceProvider.Instance and potential model contamination
across tests in CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(tests): disable EF Core global service-provider caching in integration tests

EF Core caches compiled IModel instances in a static ServiceProviderCache keyed on
DbContextOptions. When many test fixtures share the same connection strings or pool
options, a model built by an earlier test (without model customizers) can be returned
as a cache hit, causing OnModelCreating to be skipped for later tests.

Disabling service-provider caching forces EF Core to build a fresh model per pool
lifetime (per test DI container), so each integration test always gets the model
produced by its own customizers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 14:10:05 +01:00
mole 35dd350016 Merge branch 'v18/dev' into v18/feature/ef-core-repositories
# Conflicts:
#	tests/Umbraco.Tests.Integration/DependencyInjection/UmbracoBuilderExtensions.cs
2026-02-25 10:29:58 +01:00
07fe1ac22e EF Core: Add IEFCoreModelCustomizer provider-specific model configuration extension point (#21871)
* EF Core: Add IEFCoreModelCustomizer provider-specific model configuration extension point

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Ensure that the entity type exists on the model before trying to configure it

* Fix failing EFCoreModelCustomizer test and add missing negative path test

* Complete XML header docs.

* Adds an integration test to verify that IEFCoreModelCustomizer's are applied.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2026-02-23 19:01:31 +01:00
nikolajlauridsen 9ebe87ffa9 Merge remote-tracking branch 'origin/v18/dev' into v18/feature/ef-core-repositories
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
2026-02-20 09:16:12 +01:00
Nicklas KramerandGitHub 6fb533a3d9 EF Core: Covert LastSyncedRepository to EFCore (#21813)
* DTO Setup

* Implemented attempt pattern and correct EFCore logic.

* Fix to test asserts.

* Adding helper method to Upsert

* Fixing tests to assert the status code

* Fixing CacheInstructionDtoConfiguration to match EFCore standards

* Adding Migrations

* Add migration to UmbracoPlan.cs

* Helper method improvements
2026-02-20 09:06:36 +01:00
75f60aa184 EF Core: Introduce initial base repositories. (#21748)
* Only prefix table with Umbraco for OpenIddict tables

* Add EFCore references

* Add DTOs

* Register DTOs

* Add temporary test notification handler

* Hide EFCore from core scope implementation

* Use property for DbSet

* Use correct DTO in npoco

* Add core implementatino of efcore scope

* Remove obsolete code

* Move EFCore project into infrastructure

* Add dependencies

We need to have a dependency on both SQLServer and Sqlite to make AddUmbracoDbContext beacuse we allow people to register their own DBContext, this means that the distributed lock mechanism cannot simply be registered from a composer within the technology specific projects, we also need to know about OpenIddict.EntityFrameworkCore to allow us to add it when registering UmbracoContext

* Implement GetAsync using EFCore

* Register core scope facades

* Migrate repository to use EFCore

* Use efcorescopes in wehookservice

* Fix profiler

* Fix update method

* Disable EF Core change tracking and fix webhook update

Move OpenIddict to a dedicated OpenIddictDbContext so that
UmbracoDbContext can safely default to NoTracking without
breaking OpenIddict's change-tracker-dependent CRUD operations.

Replace db.Webhooks.Update(dto) with ExecuteUpdateAsync to avoid
tracking conflicts with the separate AddRangeAsync for child
collections, and remove now-redundant AsNoTracking() calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Move service registration out of composer

* Resolve TODO

* Remove old test file

* Generate migrations

* Add Miniprofiler.EntityFrameworkCore package

* Add Umbraco migration to maintain integrity of MigrationsHistory table

* Remove todo

* fix(test): register IMigrationProviderSetup in integration test DI

Integration tests don't call AddComposers(), so IMigrationProviderSetup
was never registered, causing UmbracoDbContext.ConfigureOptions to fail
with "No migration provider found for provider name Microsoft.Data.Sqlite".
Add test implementations for both SQLite and SQL Server providers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Apply suggestions from codereview

* Use UmbracoContext for OpenIddict

* Remove no longer relevant comment

* Remove configurewarnings

* Simplify scope check

* Remove old ExcludeFromMigrations

* Update src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/UmbracoDbContextModelSnapshot.cs

Co-authored-by: Andy Butland <abutland73@gmail.com>

* Update src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/UmbracoDbContextModelSnapshot.cs

Co-authored-by: Andy Butland <abutland73@gmail.com>

* Don't call SaveChanges in delete

* Don't specify nvarchar(max) for column, this is default can causes issues cross providers

* Restore the connection state properly before returning it to the pool

* Inital EF Core Friendly Base Repositories

* Use ArgumentNullException.ThrowIfNull(entity) isntead of checking for null

* Changes to reflect requested changes. Adding Async naming to methods and classes.

* Making GetAll actually Get All Entities and fix some shaky code.

* Adding cancellation tokens and an actual GetMany method implementation

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2026-02-18 12:36:20 +01:00
mole 5d74c94fcf Merge branch 'v18/dev' into v18/feature/ef-core-repositories
# Conflicts:
#	src/Umbraco.Infrastructure/Persistence/Dtos/WebhookDto.cs
2026-02-16 15:25:56 +01:00
71b251c32e EF Core: Add provider extension points for DBContext registration and database configuration. (#21746)
* Move locking mechanism

* Add extension point for providers in packages

* Make AddDbContextRegistrar feel more DI native

* Run all valid configurators, not just the first one

* Remove Umbraco.Cms.Persistence.EFCore

* Readd infrastructure project references to the two provider packages

* Allow IDbContextServiceRegistrar to provide a condition if it should run

* Update src/Umbraco.Infrastructure/Persistence/EFCore/DbContextRegistration.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix tests

* Remove EF Core project files from disk

* Fix constant name

* Remove redundant provider name check

* Add unit tests

* Fix tests properly

* docs: update CLAUDE.md files for provider registration architecture

Update documentation to reflect removal of Umbraco.Cms.Persistence.EFCore
project and the new provider registration pattern. EF Core abstractions
now live in Umbraco.Infrastructure/Persistence/EFCore/ and provider
packages depend directly on Infrastructure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 15:23:56 +01:00
nikolajlauridsen 70a4c59642 Merge branch 'v18/dev' into v18/feature/ef-core-repositories 2026-02-12 15:49:55 +01:00
54885962bd EF Core: Move persistence infrastructure into Infrastructure and migrate Webhook repositories (#21720)
* Only prefix table with Umbraco for OpenIddict tables

* Add EFCore references

* Add DTOs

* Register DTOs

* Add temporary test notification handler

* Hide EFCore from core scope implementation

* Use property for DbSet

* Use correct DTO in npoco

* Add core implementatino of efcore scope

* Remove obsolete code

* Move EFCore project into infrastructure

* Add dependencies

We need to have a dependency on both SQLServer and Sqlite to make AddUmbracoDbContext beacuse we allow people to register their own DBContext, this means that the distributed lock mechanism cannot simply be registered from a composer within the technology specific projects, we also need to know about OpenIddict.EntityFrameworkCore to allow us to add it when registering UmbracoContext

* Implement GetAsync using EFCore

* Register core scope facades

* Migrate repository to use EFCore

* Use efcorescopes in wehookservice

* Fix profiler

* Fix update method

* Disable EF Core change tracking and fix webhook update

Move OpenIddict to a dedicated OpenIddictDbContext so that
UmbracoDbContext can safely default to NoTracking without
breaking OpenIddict's change-tracker-dependent CRUD operations.

Replace db.Webhooks.Update(dto) with ExecuteUpdateAsync to avoid
tracking conflicts with the separate AddRangeAsync for child
collections, and remove now-redundant AsNoTracking() calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Move service registration out of composer

* Resolve TODO

* Remove old test file

* Generate migrations

* Add Miniprofiler.EntityFrameworkCore package

* Add Umbraco migration to maintain integrity of MigrationsHistory table

* Remove todo

* fix(test): register IMigrationProviderSetup in integration test DI

Integration tests don't call AddComposers(), so IMigrationProviderSetup
was never registered, causing UmbracoDbContext.ConfigureOptions to fail
with "No migration provider found for provider name Microsoft.Data.Sqlite".
Add test implementations for both SQLite and SQL Server providers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Apply suggestions from codereview

* Use UmbracoContext for OpenIddict

* Remove no longer relevant comment

* Remove configurewarnings

* Simplify scope check

* Remove old ExcludeFromMigrations

* Update src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/UmbracoDbContextModelSnapshot.cs

Co-authored-by: Andy Butland <abutland73@gmail.com>

* Update src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/UmbracoDbContextModelSnapshot.cs

Co-authored-by: Andy Butland <abutland73@gmail.com>

* Don't call SaveChanges in delete

* Don't specify nvarchar(max) for column, this is default can causes issues cross providers

* Restore the connection state properly before returning it to the pool

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2026-02-12 15:49:13 +01:00
495 changed files with 49365 additions and 7596 deletions
@@ -0,0 +1,263 @@
---
name: umb-ef-core-empty-migration
description: Generate empty (no-op) EF Core migration stubs for both SQL Server and SQLite providers in Umbraco CMS, create the Umbraco migration class that invokes it, add it to UmbracoPlan, and wire up the migration runner plumbing (enum + switch cases). Use this whenever you need to generate EF Core migrations after completing the DTO, configuration, and DbSet work — i.e., after completing Steps 13 of the EF Core DTO Migration Guide (Section 12 in Infrastructure CLAUDE.md). Also trigger this skill when the user mentions "dotnet ef migrations add", "adding an EF Core migration", "generating migrations for both providers", or "updating the migration runner plumbing".
argument-hint: <MigrationName>
---
# EF Core Empty Migration Generation
Automates the full workflow of adding an empty EF Core migration to Umbraco:
1. Generate empty migration stubs in both SQL Server and SQLite provider projects
2. Create the Umbraco migration class (`AsyncMigrationBase`) that runs it
3. Add it to `UmbracoPlan`
4. Wire up the migration runner plumbing (enum + switch cases)
These migrations are intentionally no-ops — NPoco creates the actual database tables. The EF Core migrations exist only to update the model snapshot so EF Core tracks the schema state correctly.
## Prerequisites Check
Before running any commands, verify Steps 13 of the EF Core DTO Migration Guide are complete (Step 4, the SQL Server model customizer, is only needed if the NPoco DTO has `[IncludeColumns]` indexes). Run these concrete checks:
- Glob `src/Umbraco.Infrastructure/Persistence/Dtos/EFCore/**Dto.cs` — confirm the expected DTO file exists, open it, and verify it has `[EntityTypeConfiguration(...)]`
- Glob `src/Umbraco.Infrastructure/Persistence/Dtos/EFCore/Configurations/**Configuration.cs` — confirm the expected configuration file exists
- Grep `src/Umbraco.Infrastructure/Persistence/EFCore/UmbracoDbContext.cs` for `DbSet<` — confirm the new DTO appears
If any check fails, tell the user which step is incomplete — do not run migration commands yet. The snapshot will silently omit the entity if the DbSet is missing.
## Before You Begin: Create Task List
Use `TaskCreate` to create a task for each step below so no sub-step is skipped (Steps 9a9c look nearly identical and are the most commonly missed):
- Step 1: Determine migration name
- Step 2: Prepare appsettings
- Step 3: Generate SQL Server migration
- Step 4: Generate SQLite migration
- Step 5: Restore appsettings
- Step 6: Empty Up() and Down() methods
- Step 7: Create Umbraco migration class
- Step 8: Add to UmbracoPlan
- Step 9a: Update EFCoreMigration enum
- Step 9b: Update SqlServerMigrationProvider switch
- Step 9c: Update SqliteMigrationProvider switch
- Step 10: Verify snapshots
## Step 1: Determine Migration Name
Use `$ARGUMENTS` as the migration name if provided. If not, ask:
> What should the migration be named? (PascalCase, e.g. `AddRelationDtos`)
Convention: names start with `Add` followed by the DTO or feature name.
## Step 2: Prepare appsettings
The EF Core tooling reads connection string settings from `src/Umbraco.Web.UI/appsettings.json` and any `appsettings.*.json` overlays (e.g., `appsettings.Development.json`). Check both files:
1. Look for `ConnectionStrings.umbracoDbDSN_ProviderName` in `appsettings.Development.json` first (if it exists), then `appsettings.json`.
2. Record the file path that contains the provider name as `settingsFile` (default to `appsettings.json` if neither file exists or neither has the key).
3. Record the current `umbracoDbDSN_ProviderName` value as `originalProviderName` (default to `Microsoft.Data.Sqlite` if absent).
The tooling needs a non-null connection string but does not need a real/reachable database.
## Step 3: Generate SQL Server Migration
Set both `umbracoDbDSN` (placeholder) and `umbracoDbDSN_ProviderName` to `Microsoft.Data.SqlClient` in `settingsFile`. If `settingsFile` doesn't exist, create a minimal `appsettings.json`:
```json
{
"ConnectionStrings": {
"umbracoDbDSN": "Server=localhost;Database=UmbracoDev;Integrated Security=true",
"umbracoDbDSN_ProviderName": "Microsoft.Data.SqlClient"
}
}
```
If the file already exists, update `umbracoDbDSN_ProviderName` to `Microsoft.Data.SqlClient` and ensure `umbracoDbDSN` is non-empty (add a placeholder if missing).
Run from the repository root:
```bash
dotnet ef migrations add <MigrationName> -s src/Umbraco.Web.UI -p src/Umbraco.Cms.Persistence.EFCore.SqlServer -c UmbracoDbContext
```
If the command fails, restore `originalProviderName` and stop. Show the full error. Common causes:
- DTO not yet registered in `UmbracoDbContext`
- Missing `[EntityTypeConfiguration]` attribute on DTO
## Step 4: Generate SQLite Migration
Update `umbracoDbDSN_ProviderName` to `Microsoft.Data.Sqlite` in `settingsFile`. If `umbracoDbDSN` is missing or empty, add the SQLite placeholder:
```json
{
"ConnectionStrings": {
"umbracoDbDSN": "Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Shared;Foreign Keys=True;Pooling=True",
"umbracoDbDSN_ProviderName": "Microsoft.Data.Sqlite"
}
}
```
Run:
```bash
dotnet ef migrations add <MigrationName> -s src/Umbraco.Web.UI -p src/Umbraco.Cms.Persistence.EFCore.Sqlite -c UmbracoDbContext
```
If the command fails, restore `originalProviderName` and stop. Show the full error.
## Step 5: Restore appsettings
- If `settingsFile` did not exist before Step 2, delete it.
- If it existed, restore `umbracoDbDSN_ProviderName` to `originalProviderName` (and remove any placeholder `umbracoDbDSN` entry that wasn't there before).
## Step 6: Empty Up() and Down() Methods
Find the two generated migration files (they will have a timestamp prefix):
```bash
ls src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/*_<MigrationName>.cs
ls src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/*_<MigrationName>.cs
```
In each file, replace the `Up()` and `Down()` method bodies with empty bodies:
```csharp
protected override void Up(MigrationBuilder migrationBuilder)
{
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
```
Do NOT touch the `.Designer.cs` files or `UmbracoDbContextModelSnapshot.cs` — those are auto-generated and must stay as produced by the tooling.
## Step 7: Create the Umbraco Migration Class
The Umbraco migration class lives in `src/Umbraco.Infrastructure/Migrations/Upgrade/V_19_0_0/`. Check whether this directory exists. If not, create it.
Create `src/Umbraco.Infrastructure/Migrations/Upgrade/V_19_0_0/<MigrationName>.cs`:
```csharp
using Umbraco.Cms.Persistence.EFCore.Migrations;
namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_19_0_0;
public class <MigrationName> : AsyncMigrationBase
{
private readonly IEFCoreMigrationExecutor _migrationExecutor;
public <MigrationName>(
IMigrationContext context,
IEFCoreMigrationExecutor migrationExecutor)
: base(context)
{
_migrationExecutor = migrationExecutor;
}
protected override async Task MigrateAsync()
{
// NO-OP migration to ensure that EF Core doesn't complain about missing migrations.
await _migrationExecutor.ExecuteSingleMigrationAsync(EFCoreMigration.<MigrationName>);
}
}
```
## Step 8: Add to UmbracoPlan
File: `src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs`
Read the file to find the last existing `To<>` call. Append a new call after it with a freshly generated GUID. The GUID must be uppercase and surrounded by curly braces (e.g., `{C8E2F7B4-5D3A-4F61-9E8C-1A2B3C4D5E6F}`).
Generate a GUID (choose one based on what's available):
```bash
# Linux/macOS
uuidgen | tr '[:lower:]' '[:upper:]'
```
```powershell
# PowerShell (Windows)
[System.Guid]::NewGuid().ToString().ToUpper()
```
Verify the generated GUID does not already appear in `UmbracoPlan.cs` before using it. Then add (substituting the actual GUID for `GENERATED-GUID-HERE`, wrapped in braces):
```csharp
To<V_19_0_0.<MigrationName>>("{GENERATED-GUID-HERE}");
```
## Step 9: Update Migration Runner Plumbing
Three files need updating so the Umbraco migration executor can invoke the new migration by name.
### 9a. EFCoreMigration Enum
File: `src/Umbraco.Infrastructure/Migrations/EFCoreMigration.cs`
Read the current enum to find the highest integer value. Add the new entry at the end with the next sequential value:
```csharp
<MigrationName> = <nextValue>,
```
### 9b. SqlServerMigrationProvider Switch
File: `src/Umbraco.Cms.Persistence.EFCore.SqlServer/SqlServerMigrationProvider.cs`
Add a case to `GetMigrationType()` before the `_ => throw` line:
```csharp
EFCoreMigration.<MigrationName> => typeof(Migrations.<MigrationName>),
```
Note: `GetMigrationType()` on the SQL Server provider returns `Type?` — it can return `null` for SQLite-only migrations (like `SqliteCollation`). For standard migrations, always return the migration type.
### 9c. SqliteMigrationProvider Switch
File: `src/Umbraco.Cms.Persistence.EFCore.Sqlite/SqliteMigrationProvider.cs`
Add the same case to `GetMigrationType()` before the `_ => throw` line:
```csharp
EFCoreMigration.<MigrationName> => typeof(Migrations.<MigrationName>),
```
Note: `GetMigrationType()` on the SQLite provider returns `Type` (non-nullable) — every enum value must have a case. Always add the case even for no-ops.
## Step 10: Verify Snapshots
Confirm the new entity was captured by the EF Core model snapshot. Look up the table name constant from the DTO (e.g., `Constants.DatabaseSchema.Tables.Relation` resolves to `"umbracoRelation"`), then search both snapshots:
```bash
grep -n "<tableName>" src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/UmbracoDbContextModelSnapshot.cs
grep -n "<tableName>" src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/UmbracoDbContextModelSnapshot.cs
```
If the table name is absent from either snapshot, the DTO was not discovered. Fix by checking:
1. `[EntityTypeConfiguration(typeof(<Name>DtoConfiguration))]` attribute is present on the DTO
2. `public required DbSet<<Name>Dto> <Foos> { get; set; }` is in `UmbracoDbContext`
Then remove the migrations and regenerate (repeating from Step 2):
```bash
dotnet ef migrations remove -s src/Umbraco.Web.UI -p src/Umbraco.Cms.Persistence.EFCore.SqlServer
dotnet ef migrations remove -s src/Umbraco.Web.UI -p src/Umbraco.Cms.Persistence.EFCore.Sqlite
```
## Completion Summary
When all steps are done, confirm each item:
- [ ] SQL Server migration generated: `src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/*_<MigrationName>.cs`
- [ ] SQLite migration generated: `src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/*_<MigrationName>.cs`
- [ ] Both EF Core migration files have empty `Up()` and `Down()` methods
- [ ] Umbraco migration class created: `src/Umbraco.Infrastructure/Migrations/Upgrade/V_19_0_0/<MigrationName>.cs`
- [ ] `UmbracoPlan.cs` — new `To<>` call added with a unique GUID
- [ ] `EFCoreMigration.cs` — new enum value added
- [ ] `SqlServerMigrationProvider.cs` — new switch case added
- [ ] `SqliteMigrationProvider.cs` — new switch case added
- [ ] Both `UmbracoDbContextModelSnapshot.cs` files contain the expected table name
- [ ] appsettings provider name restored to original value
+12 -8
View File
@@ -1,6 +1,6 @@
# Umbraco CMS - Multi-Project Repository
Enterprise-grade CMS built on .NET 10.0. This repository contains 21 production projects organized in a layered architecture with clear separation of concerns.
Enterprise-grade CMS built on .NET 10.0. This repository contains 20 production projects organized in a layered architecture with clear separation of concerns.
**Repository**: https://github.com/umbraco/Umbraco-CMS
**License**: MIT
@@ -12,7 +12,7 @@ Enterprise-grade CMS built on .NET 10.0. This repository contains 21 production
### What This Repository Contains
**21 Production Projects** organized in 3 main categories:
**20 Production Projects** organized in 3 main categories:
1. **Core Architecture** (Domain & Infrastructure)
- `Umbraco.Core` - Interface contracts, domain models, notifications
@@ -26,7 +26,7 @@ Enterprise-grade CMS built on .NET 10.0. This repository contains 21 production
- `Umbraco.Cms.Api.Common` - Shared API infrastructure
3. **Specialized Features** (Pluggable Modules)
- Persistence: EF Core (modern), NPoco (legacy) for SQL Server & SQLite
- Persistence: EF Core provider packages (SQL Server, SQLite), NPoco (legacy)
- Caching: `PublishedCache.HybridCache` (in-memory + distributed)
- Search: `Examine.Lucene` (full-text search)
- Imaging: `Imaging.ImageSharp` v1 & v2 (image processing)
@@ -57,7 +57,7 @@ Enterprise-grade CMS built on .NET 10.0. This repository contains 21 production
```
Umbraco-CMS/
├── src/ # 21 production projects
├── src/ # 20 production projects
│ ├── Umbraco.Core/ # Domain contracts (interfaces only)
│ │ └── CLAUDE.md # ⭐ Core architecture guide
│ ├── Umbraco.Infrastructure/ # Service implementations
@@ -69,9 +69,8 @@ Umbraco-CMS/
│ │ └── CLAUDE.md # ⭐ API patterns guide
│ ├── Umbraco.PublishedCache.HybridCache/ # Content caching
│ ├── Umbraco.Examine.Lucene/ # Search indexing
│ ├── Umbraco.Cms.Persistence.EFCore/ # EF Core data access
│ ├── Umbraco.Cms.Persistence.EFCore.Sqlite/
│ ├── Umbraco.Cms.Persistence.EFCore.SqlServer/
│ ├── Umbraco.Cms.Persistence.EFCore.Sqlite/ # EF Core SQLite provider
│ ├── Umbraco.Cms.Persistence.EFCore.SqlServer/ # EF Core SQL Server provider
│ ├── Umbraco.Cms.Persistence.Sqlite/ # Legacy SQLite
│ ├── Umbraco.Cms.Persistence.SqlServer/ # Legacy SQL Server
│ ├── Umbraco.Cms.Imaging.ImageSharp/ # Image processing v1
@@ -398,7 +397,12 @@ When updating dependencies, decide which file the package belongs in:
The repository contains BOTH (actively supported):
- **Current**: NPoco-based persistence (`Umbraco.Cms.Persistence.Sqlite`, `Umbraco.Cms.Persistence.SqlServer`) - widely used and fully supported
- **Future**: EF Core-based persistence (`Umbraco.Cms.Persistence.EFCore.*`) - migration in progress
- **Future**: EF Core-based persistence - migration in progress
**EF Core Architecture**:
- **Abstractions** (DbContext, migrations, scoping, provider registration contracts) live in `Umbraco.Infrastructure/Persistence/EFCore/`
- **Provider packages** (`Umbraco.Cms.Persistence.EFCore.SqlServer`, `Umbraco.Cms.Persistence.EFCore.Sqlite`) implement provider-specific functionality (database configuration, distributed locking, migrations)
- **Provider Registration Pattern**: `DbContextRegistration` coordinates provider setup using `IDbContextServiceRegistrar` and `IDatabaseConfigurator` contracts, enabling bidirectional replay so providers can register before or after DbContext types
**Note**: The codebase is actively migrating to EF Core, but NPoco remains the primary persistence layer and is not deprecated. Both are fully supported.
+3
View File
@@ -20,6 +20,8 @@
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.3.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.3.0" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="10.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.7" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.7" />
@@ -59,6 +61,7 @@
<PackageVersion Include="Markdown" Version="2.2.1" />
<PackageVersion Include="MessagePack" Version="3.1.4" />
<PackageVersion Include="MiniProfiler.AspNetCore.Mvc" Version="4.5.4" />
<PackageVersion Include="MiniProfiler.EntityFrameworkCore" Version="4.5.4" />
<PackageVersion Include="MiniProfiler.Shared" Version="4.5.4" />
<PackageVersion Include="ncrontab" Version="3.4.0" />
<PackageVersion Include="NPoco" Version="6.2.0" />
@@ -38,7 +38,7 @@ internal sealed class RequestMemberAccessService : IRequestMemberAccessService
public async Task<PublicAccessStatus> MemberHasAccessToAsync(IPublishedContent content)
{
PublicAccessEntry? publicAccessEntry = _publicAccessService.GetEntryForContent(content.Path);
PublicAccessEntry? publicAccessEntry = await _publicAccessService.GetEntryForContentAsync(content.Path);
if (publicAccessEntry is null)
{
return PublicAccessStatus.AccessAccepted;
@@ -114,7 +114,7 @@ public abstract class DocumentTreeControllerBase : UserStartNodeTreeControllerBa
if (entity is IDocumentEntitySlim documentEntitySlim)
{
responseModel.IsProtected = _publicAccessService.IsProtected(entity.Path);
responseModel.IsProtected = (await _publicAccessService.IsProtectedAsync(entity.Path)).Success;
responseModel.Ancestors = EntityService.GetPathKeys(entity, omitSelf: true)
.Select(x => new ReferenceByIdModel(x));
responseModel.IsTrashed = entity.Trashed;
@@ -6,7 +6,6 @@ using Umbraco.Cms.Api.Management.Services.Entities;
using Umbraco.Cms.Api.Management.ViewModels.Item;
using Umbraco.Cms.Api.Management.ViewModels.Media.Item;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
namespace Umbraco.Cms.Api.Management.Controllers.Media.Item;
@@ -14,15 +13,12 @@ namespace Umbraco.Cms.Api.Management.Controllers.Media.Item;
public class AncestorsMediaItemController : MediaItemControllerBase
{
private readonly IItemAncestorService _itemAncestorService;
private readonly IMediaPresentationFactory _mediaPresentationFactory;
public AncestorsMediaItemController(
IItemAncestorService itemAncestorService,
IMediaPresentationFactory mediaPresentationFactory)
{
_itemAncestorService = itemAncestorService;
_mediaPresentationFactory = mediaPresentationFactory;
}
: base(mediaPresentationFactory)
=> _itemAncestorService = itemAncestorService;
[HttpGet("ancestors")]
[MapToApiVersion("1.0")]
@@ -42,10 +38,7 @@ public class AncestorsMediaItemController : MediaItemControllerBase
UmbracoObjectTypes.Media,
null,
ids,
ancestors => Task.FromResult(
ancestors
.OfType<IMediaEntitySlim>()
.Select(_mediaPresentationFactory.CreateItemResponseModel)));
MapMediaItemsAsync);
return Ok(result);
}
@@ -17,7 +17,6 @@ namespace Umbraco.Cms.Api.Management.Controllers.Media.Item;
public class ItemMediaItemController : MediaItemControllerBase
{
private readonly IEntityService _entityService;
private readonly IMediaPresentationFactory _mediaPresentationFactory;
private readonly FlagProviderCollection _flagProviders;
/// <summary>
@@ -30,9 +29,9 @@ public class ItemMediaItemController : MediaItemControllerBase
IEntityService entityService,
IMediaPresentationFactory mediaPresentationFactory,
FlagProviderCollection flagProviders)
: base(mediaPresentationFactory)
{
_entityService = entityService;
_mediaPresentationFactory = mediaPresentationFactory;
_flagProviders = flagProviders;
}
@@ -50,11 +49,9 @@ public class ItemMediaItemController : MediaItemControllerBase
return Ok(Enumerable.Empty<MediaItemResponseModel>());
}
IEnumerable<IMediaEntitySlim> media = _entityService
.GetAll(UmbracoObjectTypes.Media, ids.ToArray())
.OfType<IMediaEntitySlim>();
IEnumerable<IEntitySlim> media = _entityService.GetAll(UmbracoObjectTypes.Media, ids.ToArray());
IEnumerable<MediaItemResponseModel> responseModels = media.Select(_mediaPresentationFactory.CreateItemResponseModel);
IEnumerable<MediaItemResponseModel> responseModels = await MapMediaItemsAsync(media);
await PopulateFlags(responseModels);
return Ok(responseModels);
@@ -1,6 +1,9 @@
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.Routing;
using Umbraco.Cms.Api.Management.ViewModels.Media.Item;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models.Entities;
namespace Umbraco.Cms.Api.Management.Controllers.Media.Item;
@@ -12,4 +15,28 @@ namespace Umbraco.Cms.Api.Management.Controllers.Media.Item;
[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Media))]
public class MediaItemControllerBase : ManagementApiControllerBase
{
private readonly IMediaPresentationFactory _mediaPresentationFactory;
/// <summary>
/// Initializes a new instance of the <see cref="MediaItemControllerBase"/> class.
/// </summary>
/// <param name="mediaPresentationFactory">Factory responsible for creating media presentation models.</param>
public MediaItemControllerBase(IMediaPresentationFactory mediaPresentationFactory)
=> _mediaPresentationFactory = mediaPresentationFactory;
/// <summary>
/// Maps a collection of media entities to their response models.
/// </summary>
/// <param name="entities">The entities to map.</param>
/// <returns>The mapped media item response models.</returns>
protected async Task<IEnumerable<MediaItemResponseModel>> MapMediaItemsAsync(IEnumerable<IEntitySlim> entities)
{
List<MediaItemResponseModel> mapped = [];
foreach (IMediaEntitySlim entity in entities.OfType<IMediaEntitySlim>())
{
mapped.Add(await _mediaPresentationFactory.CreateItemResponseModelAsync(entity));
}
return mapped;
}
}
@@ -18,7 +18,6 @@ namespace Umbraco.Cms.Api.Management.Controllers.Media.Item;
public class SearchMediaItemController : MediaItemControllerBase
{
private readonly IIndexedEntitySearchService _indexedEntitySearchService;
private readonly IMediaPresentationFactory _mediaPresentationFactory;
private readonly IDataTypeService _dataTypeService;
/// <summary>
@@ -31,9 +30,9 @@ public class SearchMediaItemController : MediaItemControllerBase
IIndexedEntitySearchService indexedEntitySearchService,
IMediaPresentationFactory mediaPresentationFactory,
IDataTypeService dataTypeService)
: base(mediaPresentationFactory)
{
_indexedEntitySearchService = indexedEntitySearchService;
_mediaPresentationFactory = mediaPresentationFactory;
_dataTypeService = dataTypeService;
}
@@ -85,7 +84,7 @@ public class SearchMediaItemController : MediaItemControllerBase
ignoreUserStartNodes);
var result = new PagedModel<MediaItemResponseModel>
{
Items = searchResult.Items.OfType<IMediaEntitySlim>().Select(_mediaPresentationFactory.CreateItemResponseModel),
Items = await MapMediaItemsAsync(searchResult.Items),
Total = searchResult.Total,
};
@@ -34,16 +34,16 @@ public class ByKeyRelationTypeController : RelationTypeControllerBase
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Gets a relation type.")]
[EndpointDescription("Gets a relation type identified by the provided Id.")]
public Task<IActionResult> ByKey(CancellationToken cancellationToken, Guid id)
public async Task<IActionResult> ByKey(CancellationToken cancellationToken, Guid id)
{
IRelationType? relationType = _relationService.GetRelationTypeById(id);
IRelationType? relationType = await _relationService.GetRelationTypeByKeyAsync(id, cancellationToken);
if (relationType is null)
{
return Task.FromResult(RelationTypeNotFound());
return RelationTypeNotFound();
}
RelationTypeResponseModel mappedRelationType = _mapper.Map<RelationTypeResponseModel>(relationType)!;
return Task.FromResult<IActionResult>(Ok(mappedRelationType));
return Ok(mappedRelationType);
}
}
@@ -39,23 +39,23 @@ public class ItemRelationTypeItemController : RelationTypeItemControllerBase
[ProducesResponseType(typeof(IEnumerable<RelationTypeItemResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a collection of relation type items.")]
[EndpointDescription("Gets a collection of relation type items identified by the provided Ids.")]
public Task<IActionResult> Item(
public async Task<IActionResult> Item(
CancellationToken cancellationToken,
[FromQuery(Name = "id")] HashSet<Guid> ids)
{
if (ids.Count is 0)
{
return Task.FromResult<IActionResult>(Ok(Enumerable.Empty<RelationTypeItemResponseModel>()));
return Ok(Enumerable.Empty<RelationTypeItemResponseModel>());
}
// relation service does not allow fetching a collection of relation types by their ids; instead it relies
// heavily on caching, which means this is as fast as it gets - even if it looks less than performant
IRelationType[] relationTypes = _relationService
.GetAllRelationTypes()
IRelationType[] relationTypes = (await _relationService
.GetAllRelationTypesAsync([], cancellationToken))
.Where(relationType => ids.Contains(relationType.Key)).ToArray();
List<RelationTypeItemResponseModel> responseModels = _mapper.MapEnumerable<IRelationType, RelationTypeItemResponseModel>(relationTypes);
return Task.FromResult<IActionResult>(Ok(responseModels));
return Ok(responseModels);
}
}
@@ -30,6 +30,6 @@ public class GetTelemetryController : TelemetryControllerBase
[ProducesResponseType(typeof(TelemetryResponseModel), StatusCodes.Status200OK)]
[EndpointSummary("Gets telemetry information.")]
[EndpointDescription("Gets the current telemetry configuration and consent level.")]
public Task<TelemetryRepresentationBase> Get(CancellationToken cancellationToken)
=> Task.FromResult<TelemetryRepresentationBase>(new TelemetryResponseModel { TelemetryLevel = _metricsConsentService.GetConsentLevel() });
public async Task<TelemetryRepresentationBase> Get(CancellationToken cancellationToken)
=> new TelemetryResponseModel { TelemetryLevel = await _metricsConsentService.GetConsentLevelAsync() };
}
@@ -205,11 +205,16 @@ public abstract class FolderTreeControllerBase<TItem> : NamedEntityTreeControlle
protected virtual async Task<TItem[]> MapSearchTreeItemViewModelsAsync(IEntitySlim[] entities)
{
IEnumerable<Task<TItem>> tasks = entities.Select(entity => MapTreeItemViewModelAsync(GetSearchResultParentKey(entity), entity));
return await Task.WhenAll(tasks);
List<TItem> result = [];
foreach (IEntitySlim entity in entities)
{
result.Add(await MapTreeItemViewModelAsync(await GetSearchResultParentKey(entity), entity));
}
return result.ToArray();
}
private Guid? GetSearchResultParentKey(IEntitySlim entity)
private async Task<Guid?> GetSearchResultParentKey(IEntitySlim entity)
{
if (entity.ParentId == Constants.System.Root)
{
@@ -218,14 +223,14 @@ public abstract class FolderTreeControllerBase<TItem> : NamedEntityTreeControlle
if (FolderObjectType != UmbracoObjectTypes.Unknown)
{
Attempt<Guid> getKeyAttempt = IdKeyMap.GetKeyForId(entity.ParentId, FolderObjectType);
Attempt<Guid> getKeyAttempt = await IdKeyMap.GetKeyForIdAsync(entity.ParentId, FolderObjectType);
if (getKeyAttempt.Success)
{
return getKeyAttempt.Result;
}
}
Attempt<Guid> itemKeyAttempt = IdKeyMap.GetKeyForId(entity.ParentId, ItemObjectType);
Attempt<Guid> itemKeyAttempt = await IdKeyMap.GetKeyForIdAsync(entity.ParentId, ItemObjectType);
if (itemKeyAttempt.Success)
{
return itemKeyAttempt.Result;
@@ -77,7 +77,7 @@ public static partial class UmbracoBuilderExtensions
services.AddScoped<IBackOfficeExternalLoginService, BackOfficeExternalLoginService>();
// Register a notification handler to interrogate the registered external login providers at startup.
builder.AddNotificationHandler<UmbracoApplicationStartingNotification, ExternalLoginProviderStartupHandler>();
builder.AddNotificationAsyncHandler<UmbracoApplicationStartingNotification, ExternalLoginProviderStartupHandler>();
return builder;
}
@@ -35,12 +35,12 @@ public class DocumentCollectionPresentationFactory : ContentCollectionPresentati
}
/// <inheritdoc/>
protected override Task SetUnmappedProperties(ListViewPagedModel<IContent> contentCollection, List<DocumentCollectionResponseModel> collectionResponseModels)
protected override async Task SetUnmappedProperties(ListViewPagedModel<IContent> contentCollection, List<DocumentCollectionResponseModel> collectionResponseModels)
{
// Retrieve all public access entries once (single scope) instead of
// calling IsProtected per item which creates N scopes.
var protectedNodeIds = new HashSet<int>(
_publicAccessService.GetAll().Select(entry => entry.ProtectedNodeId));
(await _publicAccessService.GetAllAsync()).Select(entry => entry.ProtectedNodeId));
// All items in a collection are siblings (same parent), so with omitSelf
// they share the same ancestor array. Compute once, reuse for all.
@@ -62,8 +62,6 @@ public class DocumentCollectionPresentationFactory : ContentCollectionPresentati
.ToArray();
item.Ancestors = sharedAncestors;
}
return Task.CompletedTask;
}
/// <summary>
@@ -88,7 +88,7 @@ internal sealed class DocumentPresentationFactory
/// <inheritdoc/>
public async Task<DocumentItemResponseModel> CreateItemResponseModelAsync(IDocumentEntitySlim entity)
{
Attempt<Guid> parentKeyAttempt = _idKeyMap.GetKeyForId(entity.ParentId, UmbracoObjectTypes.Document);
Attempt<Guid> parentKeyAttempt = await _idKeyMap.GetKeyForIdAsync(entity.ParentId, UmbracoObjectTypes.Document);
var responseModel = new DocumentItemResponseModel
{
@@ -96,7 +96,7 @@ internal sealed class DocumentPresentationFactory
IsTrashed = entity.Trashed,
Parent = parentKeyAttempt.Success ? new ReferenceByIdModel { Id = parentKeyAttempt.Result } : null,
HasChildren = entity.HasChildren,
IsProtected = _publicAccessService.IsProtected(entity.Path),
IsProtected = (await _publicAccessService.IsProtectedAsync(entity.Path)).Success,
DocumentType = CreateDocumentTypeReferenceResponseModel(entity),
Variants = await CreateVariantsItemResponseModelsAsync(entity),
};
@@ -47,7 +47,7 @@ internal sealed class ElementPresentationFactory
/// <inheritdoc />
public async Task<ElementItemResponseModel> CreateItemResponseModelAsync(IElementEntitySlim entity)
{
Attempt<Guid> parentKeyAttempt = _idKeyMap.GetKeyForId(entity.ParentId, UmbracoObjectTypes.ElementContainer);
Attempt<Guid> parentKeyAttempt = await _idKeyMap.GetKeyForIdAsync(entity.ParentId, UmbracoObjectTypes.ElementContainer);
var responseModel = new ElementItemResponseModel
{
@@ -24,7 +24,7 @@ public interface IMediaPresentationFactory
/// </summary>
/// <param name="entity">The media entity to create the response model from.</param>
/// <returns>A <see cref="MediaItemResponseModel"/> representing the media entity.</returns>
MediaItemResponseModel CreateItemResponseModel(IMediaEntitySlim entity);
Task<MediaItemResponseModel> CreateItemResponseModelAsync(IMediaEntitySlim entity);
/// <summary>
/// Creates variant item response models for the specified media entity.
@@ -41,9 +41,9 @@ internal sealed class MediaPresentationFactory : IMediaPresentationFactory
/// </summary>
/// <param name="entity">The media entity to create the response model from.</param>
/// <returns>A <see cref="MediaItemResponseModel"/> representing the media entity.</returns>
public MediaItemResponseModel CreateItemResponseModel(IMediaEntitySlim entity)
public async Task<MediaItemResponseModel> CreateItemResponseModelAsync(IMediaEntitySlim entity)
{
Attempt<Guid> parentKeyAttempt = _idKeyMap.GetKeyForId(entity.ParentId, UmbracoObjectTypes.Media);
Attempt<Guid> parentKeyAttempt = await _idKeyMap.GetKeyForIdAsync(entity.ParentId, UmbracoObjectTypes.Media);
return new MediaItemResponseModel
{
@@ -11,7 +11,7 @@ namespace Umbraco.Cms.Api.Management.NotificationHandlers;
/// Invalidates backoffice sessions and clears external logins for removed providers if the external login
/// provider setup has changed.
/// </summary>
internal sealed class ExternalLoginProviderStartupHandler : INotificationHandler<UmbracoApplicationStartingNotification>
internal sealed class ExternalLoginProviderStartupHandler : INotificationAsyncHandler<UmbracoApplicationStartingNotification>
{
private readonly IBackOfficeExternalLoginProviders _backOfficeExternalLoginProviders;
private readonly IRuntimeState _runtimeState;
@@ -31,7 +31,7 @@ internal sealed class ExternalLoginProviderStartupHandler : INotificationHandler
}
/// <inheritdoc/>
public void Handle(UmbracoApplicationStartingNotification notification)
public async Task HandleAsync(UmbracoApplicationStartingNotification notification, CancellationToken cancellationToken)
{
if (_runtimeState.Level != RuntimeLevel.Run ||
_serverRoleAccessor.CurrentServerRole == ServerRole.Subscriber)
@@ -39,6 +39,6 @@ internal sealed class ExternalLoginProviderStartupHandler : INotificationHandler
return;
}
_backOfficeExternalLoginProviders.InvalidateSessionsIfExternalLoginProvidersChanged();
await _backOfficeExternalLoginProviders.InvalidateSessionsIfExternalLoginProvidersChangedAsync();
}
}
@@ -85,9 +85,9 @@ public class BackOfficeExternalLoginProviders : IBackOfficeExternalLoginProvider
}
/// <inheritdoc />
public void InvalidateSessionsIfExternalLoginProvidersChanged()
public async Task InvalidateSessionsIfExternalLoginProvidersChangedAsync()
{
var previousExternalLoginProvidersValue = _keyValueService.GetValue(ExternalLoginProvidersKey);
var previousExternalLoginProvidersValue = await _keyValueService.GetValueAsync(ExternalLoginProvidersKey);
var currentExternalLoginProvidersValue = string.Join("|", _externalLogins.Keys.OrderBy(key => key));
if ((previousExternalLoginProvidersValue ?? string.Empty) != currentExternalLoginProvidersValue)
@@ -97,11 +97,11 @@ public class BackOfficeExternalLoginProviders : IBackOfficeExternalLoginProvider
_externalLoginWithKeyService.PurgeLoginsForRemovedProviders(_externalLogins.Keys);
_keyValueService.SetValue(ExternalLoginProvidersKey, currentExternalLoginProvidersValue);
await _keyValueService.SetValueAsync(ExternalLoginProvidersKey, currentExternalLoginProvidersValue);
}
else if (previousExternalLoginProvidersValue is null)
{
_keyValueService.SetValue(ExternalLoginProvidersKey, string.Empty);
await _keyValueService.SetValueAsync(ExternalLoginProvidersKey, string.Empty);
}
}
}
@@ -29,5 +29,5 @@ public interface IBackOfficeExternalLoginProviders
/// If they are different, this will invalidate backoffice sessions and clear external logins for removed providers
/// if the external login provider setup has changed.
/// </summary>
void InvalidateSessionsIfExternalLoginProvidersChanged() { }
Task InvalidateSessionsIfExternalLoginProvidersChangedAsync();
}
@@ -665,7 +665,7 @@ internal sealed class ServerEventSender :
var seen = new HashSet<Guid>();
foreach (PublicAccessEntry entity in entities)
{
Attempt<Guid> getKeyAttempt = _idKeyMap.GetKeyForId(entity.ProtectedNodeId, UmbracoObjectTypes.Document);
Attempt<Guid> getKeyAttempt = await _idKeyMap.GetKeyForIdAsync(entity.ProtectedNodeId, UmbracoObjectTypes.Document);
if (getKeyAttempt.Success is false)
{
continue;
@@ -1,10 +1,10 @@
# Umbraco.Cms.Persistence.EFCore.SqlServer
SQL Server-specific EF Core provider for Umbraco CMS. Contains SQL Server migrations and provider setup for the EF Core persistence layer.
SQL Server-specific EF Core provider for Umbraco CMS. Implements SQL Server database configuration, distributed locking, migrations, and service registration for the EF Core persistence layer.
**Project Type**: Class Library (NuGet package)
**Target Framework**: net10.0
**Dependencies**: Umbraco.Cms.Persistence.EFCore
**Dependencies**: Umbraco.Infrastructure
---
@@ -12,11 +12,14 @@ SQL Server-specific EF Core provider for Umbraco CMS. Contains SQL Server migrat
### Project Purpose
This is a thin provider project that implements SQL Server-specific functionality for the EF Core persistence layer:
This provider project implements SQL Server-specific functionality for the EF Core persistence layer:
1. **Migration Provider** - Executes SQL Server-specific migrations
2. **Migration Provider Setup** - Configures DbContext to use SQL Server
3. **Migrations** - SQL Server-specific migration files for OpenIddict tables
1. **Database Configurator** - Configures DbContext with SQL Server-specific options (`IDatabaseConfigurator`)
2. **Service Registrar** - Registers SQL Server-specific services like distributed locking (`IDbContextServiceRegistrar`)
3. **Distributed Locking** - SQL Server-specific distributed locking mechanism
4. **Migration Provider** - Executes SQL Server-specific EF Core migrations
5. **Migration Provider Setup** - Configures DbContext to use SQL Server for migrations
6. **Migrations** - SQL Server-specific migration files (OpenIddict tables, webhooks, etc.)
### Folder Structure
@@ -27,19 +30,26 @@ Umbraco.Cms.Persistence.EFCore.SqlServer/
│ ├── 20230807654321_AddOpenIddict.cs # OpenIddict tables
│ ├── 20240403140654_UpdateOpenIddictToV5.cs # OpenIddict v5 schema changes
│ ├── 20251006140751_UpdateOpenIddictToV7.cs # Token Type column expansion
│ ├── 20260209102250_AddWebhookDto.cs # Webhook tables
│ └── UmbracoDbContextModelSnapshot.cs # Current model state
├── EFCoreSqlServerComposer.cs # DI registration
├── SqlServerDatabaseConfigurator.cs # IDatabaseConfigurator impl
├── SqlServerDbContextServiceRegistrar.cs # IDbContextServiceRegistrar impl
├── SqlServerEFCoreDistributedLockingMechanism.cs # Distributed locking
├── SqlServerMigrationProvider.cs # IMigrationProvider impl
── SqlServerMigrationProviderSetup.cs # IMigrationProviderSetup impl
── SqlServerMigrationProviderSetup.cs # IMigrationProviderSetup impl
└── UmbracoBuilderExtensions.cs # IUmbracoBuilder extensions
```
### Relationship with Parent Project
### Relationship with Infrastructure
This project extends `Umbraco.Cms.Persistence.EFCore`:
This project extends `Umbraco.Infrastructure`:
- Implements `IMigrationProvider` interface defined in parent
- Implements `IMigrationProviderSetup` interface defined in parent
- Uses `UmbracoDbContext` from parent project
- Implements `IDatabaseConfigurator` interface defined in Infrastructure
- Implements `IDbContextServiceRegistrar` interface defined in Infrastructure
- Implements `IMigrationProvider` interface defined in Infrastructure
- Implements `IMigrationProviderSetup` interface defined in Infrastructure
- Uses `UmbracoDbContext` from Infrastructure
- Provider name: `Microsoft.Data.SqlClient` (from `Constants.ProviderNames.SQLServer`)
---
@@ -47,24 +57,47 @@ This project extends `Umbraco.Cms.Persistence.EFCore`:
## 2. Commands
**For Git workflow and build commands**, see [repository root](../../CLAUDE.md).
**For EF Core migration commands**, see [parent project](../Umbraco.Cms.Persistence.EFCore/CLAUDE.md) (substitute `-p src/Umbraco.Cms.Persistence.EFCore.SqlServer`).
```bash
# Build this project
dotnet build src/Umbraco.Cms.Persistence.EFCore.SqlServer
# Run related tests
dotnet test --filter "FullyQualifiedName~EFCore"
```
---
## 3. Key Components
### EFCoreSqlServerComposer (line 10-14)
### EFCoreSqlServerComposer
Registers SQL Server implementations of `IMigrationProvider` and `IMigrationProviderSetup`.
Registers SQL Server implementations of `IMigrationProvider`, `IMigrationProviderSetup`, and provider registration services.
### SqlServerDatabaseConfigurator
Implements `IDatabaseConfigurator` to configure `DbContextOptionsBuilder` with `UseSqlServer`. Called by `DbContextRegistration` when registering DbContext types.
### SqlServerDbContextServiceRegistrar
Implements `IDbContextServiceRegistrar` to register SQL Server-specific services (e.g., distributed locking) for each registered DbContext type.
### SqlServerEFCoreDistributedLockingMechanism
SQL Server-specific distributed locking implementation using database-level locks. Moved from Infrastructure to this provider package as it is provider-specific.
### SqlServerMigrationProvider
Executes migrations via `MigrateAsync(EFCoreMigration)` or `MigrateAllAsync()`. Unlike SQLite sibling, no transaction check needed (SQL Server handles concurrent migrations natively).
### SqlServerMigrationProviderSetup (line 11-14)
### SqlServerMigrationProviderSetup
Configures `DbContextOptionsBuilder` with `UseSqlServer` and migrations assembly.
### UmbracoBuilderExtensions
Extension methods on `IUmbracoBuilder` for adding SQL Server EF Core support to the application.
---
## 4. Migrations
@@ -75,8 +108,9 @@ Configures `DbContextOptionsBuilder` with `UseSqlServer` and migrations assembly
|-----------|------|---------|
| `InitialCreate` | 2023-06-22 | No-op - NPoco creates base tables |
| `AddOpenIddict` | 2023-08-07 | Creates OpenIddict tables |
| `UpdateOpenIddictToV5` | 2024-04-03 | Renames TypeClientType, adds ApplicationType/JsonWebKeySet/Settings |
| `UpdateOpenIddictToV5` | 2024-04-03 | Renames Type->ClientType, adds ApplicationType/JsonWebKeySet/Settings |
| `UpdateOpenIddictToV7` | 2025-10-06 | Expands Token.Type from nvarchar(50) to nvarchar(150) |
| `AddWebhookDto` | 2026-02-09 | Webhook tables |
### OpenIddict Tables Created
@@ -91,9 +125,27 @@ Prefixed with `umbraco`: Applications, Authorizations, Scopes, Tokens (see SQLit
### Adding New Migrations
1. Configure SQL Server connection string in `src/Umbraco.Web.UI/appsettings.json`
2. Run migration command from repository root (see parent project docs)
3. **Critical**: Also add equivalent migration to `Umbraco.Cms.Persistence.EFCore.Sqlite`
4. Update `SqlServerMigrationProvider.GetMigrationType()` switch (line 27-35) if adding named migrations
2. Run from repository root:
```bash
dotnet ef migrations add %Name% -s src/Umbraco.Web.UI -p src/Umbraco.Cms.Persistence.EFCore.SqlServer -c UmbracoDbContext
```
3. Empty the `Up()` and `Down()` methods (these are no-ops — NPoco creates the tables)
4. **Critical**: Also add equivalent migration to `Umbraco.Cms.Persistence.EFCore.Sqlite`
5. Update `SqlServerMigrationProvider.GetMigrationType()` switch if adding named migrations
### Model Customizers (`DtoCustomization/`)
SQL Server-specific EF Core model customizations (e.g., indexes with included columns via `.IncludeProperties()`) live in `DtoCustomization/`. These extend the shared configurations in `Umbraco.Infrastructure/Persistence/Dtos/EFCore/Configurations/`.
**Pattern**: Implement `IEFCoreModelCustomizer<TDto>` and register via `builder.AddEFCoreModelCustomizer<T>()` in `UmbracoBuilderExtensions.AddCustomizers()`.
**Current customizers**:
- `SqlServerNodeDtoModelCustomizer` — adds `.IncludeProperties()` to `NodeDto` indexes
- `SqlServerDocumentVersionDtoModelCustomizer` — adds `.IncludeProperties()` to `DocumentVersionDto` indexes
**When to add a new customizer**: Only when the NPoco DTO has SQL Server-specific index features (included columns via `[IncludeColumns]`). If the DTO has no included columns, no customizer is needed.
**Full migration guide**: See `/src/Umbraco.Infrastructure/CLAUDE.md` → "Section 12: EF Core DTO Migration Guide".
---
@@ -101,7 +153,7 @@ Prefixed with `umbraco`: Applications, Authorizations, Scopes, Tokens (see SQLit
### Named Migration Mapping
`SqlServerMigrationProvider.GetMigrationType()` (line 27-35) maps `EFCoreMigration` enum to migration types. Update both parent enum and this switch when adding named migrations.
`SqlServerMigrationProvider.GetMigrationType()` maps `EFCoreMigration` enum to migration types. Update both the enum in Infrastructure and this switch when adding named migrations.
### Transaction Handling
@@ -119,14 +171,18 @@ SQL Server handles concurrent migrations natively - no transaction check needed
| File | Purpose |
|------|---------|
| `SqlServerDatabaseConfigurator.cs` | DbContext configuration (IDatabaseConfigurator) |
| `SqlServerDbContextServiceRegistrar.cs` | Provider service registration (IDbContextServiceRegistrar) |
| `SqlServerEFCoreDistributedLockingMechanism.cs` | Distributed locking |
| `SqlServerMigrationProvider.cs` | Migration execution |
| `SqlServerMigrationProviderSetup.cs` | DbContext configuration |
| `SqlServerMigrationProviderSetup.cs` | Migration DbContext configuration |
| `EFCoreSqlServerComposer.cs` | DI registration |
| `UmbracoBuilderExtensions.cs` | Builder extensions |
| `Migrations/*.cs` | Migration files |
### Provider Name
`Constants.ProviderNames.SQLServer` = `"Microsoft.Data.SqlClient"`
### Related Projects
- **Parent**: `Umbraco.Cms.Persistence.EFCore` - Interfaces and base DbContext
- **Parent**: `Umbraco.Infrastructure` - EF Core abstractions, DbContext, provider registration contracts
- **Sibling**: `Umbraco.Cms.Persistence.EFCore.Sqlite` - SQLite equivalent
@@ -0,0 +1,44 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Umbraco.Cms.Core;
using Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.DtoCustomization;
/// <summary>
/// Adds SQL Server-specific included columns to <see cref="NodeDto"/> indexes.
/// </summary>
public class SqlServerNodeDtoModelCustomizer : IEFCoreModelCustomizer<NodeDto>
{
public string? ProviderName => Constants.ProviderNames.SQLServer;
public void Customize(EntityTypeBuilder<NodeDto> builder)
{
// IX_umbracoNode_UniqueId
builder.HasIndex(x => x.UniqueId)
.IsUnique()
.HasDatabaseName($"IX_{NodeDto.TableName}_UniqueId")
.IncludeProperties(x => new { x.ParentId, x.Level, x.Path, x.SortOrder, x.Trashed, x.UserId, x.Text, x.CreateDate });
// IX_umbracoNode_parentId_nodeObjectType
builder.HasIndex(x => new { x.ParentId, x.NodeObjectType })
.HasDatabaseName($"IX_{NodeDto.TableName}_parentId_nodeObjectType")
.IncludeProperties(x => new { x.Trashed, x.UserId, x.Level, x.Path, x.SortOrder, x.UniqueId, x.Text, x.CreateDate });
// IX_umbracoNode_Level
builder.HasIndex(x => new { x.Level, x.ParentId, x.SortOrder, x.NodeObjectType, x.Trashed })
.HasDatabaseName($"IX_{NodeDto.TableName}_Level")
.IncludeProperties(x => new { x.UserId, x.Path, x.UniqueId, x.CreateDate });
// IX_umbracoNode_ObjectType_trashed_sorted
builder.HasIndex(x => new { x.NodeObjectType, x.Trashed, x.SortOrder, x.NodeId })
.HasDatabaseName($"IX_{NodeDto.TableName}_ObjectType_trashed_sorted")
.IncludeProperties(x => new { x.UniqueId, x.ParentId, x.Level, x.Path, x.UserId, x.Text, x.CreateDate });
// IX_umbracoNode_ObjectType
builder.HasIndex(x => new { x.NodeObjectType, x.Trashed })
.HasDatabaseName($"IX_{NodeDto.TableName}_ObjectType")
.IncludeProperties(x => new { x.UniqueId, x.ParentId, x.Level, x.Path, x.SortOrder, x.UserId, x.Text, x.CreateDate });
}
}
@@ -1,19 +1,14 @@
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Persistence.EFCore.Migrations;
namespace Umbraco.Cms.Persistence.EFCore.SqlServer;
/// <summary>
/// Composer for registering SQL Server EF Core migration services.
/// Automatically adds SQL Server EF Core support to Umbraco when this project is referenced.
/// </summary>
public class EFCoreSqlServerComposer : IComposer
{
/// <inheritdoc />
public void Compose(IUmbracoBuilder builder)
{
builder.Services.AddSingleton<IMigrationProvider, SqlServerMigrationProvider>();
builder.Services.AddSingleton<IMigrationProviderSetup, SqlServerMigrationProviderSetup>();
}
=> builder.AddUmbracoEFCoreSqlServerSupport();
}
@@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
@@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
@@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
using Umbraco.Cms.Persistence.EFCore;
#nullable disable
@@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
using Umbraco.Cms.Persistence.EFCore;
#nullable disable
@@ -0,0 +1,407 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260209102250_AddWebhookDto")]
partial class AddWebhookDto
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("ClientSecret")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("JsonWebKeySet")
.HasColumnType("nvarchar(max)");
b.Property<string>("Permissions")
.HasColumnType("nvarchar(max)");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("RedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Requirements")
.HasColumnType("nvarchar(max)");
b.Property<string>("Settings")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique()
.HasFilter("[ClientId] IS NOT NULL");
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Scopes")
.HasColumnType("nvarchar(max)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("Descriptions")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Resources")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique()
.HasFilter("[Name] IS NOT NULL");
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("AuthorizationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("datetime2");
b.Property<string>("Payload")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("datetime2");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique()
.HasFilter("[ReferenceId] IS NOT NULL");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("nvarchar(255)")
.HasColumnName("event");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("nvarchar(450)")
.HasColumnName("Key");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasColumnType("nvarchar(max)")
.HasColumnName("description");
b.Property<bool>("Enabled")
.HasColumnType("bit")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("uniqueidentifier")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)")
.HasColumnName("name");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("url");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,22 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddWebhookDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// NO-OP to make EFCore happy
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,464 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260219114227_AddLastSyncedDto")]
partial class AddLastSyncedDto
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("ClientSecret")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("JsonWebKeySet")
.HasColumnType("nvarchar(max)");
b.Property<string>("Permissions")
.HasColumnType("nvarchar(max)");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("RedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Requirements")
.HasColumnType("nvarchar(max)");
b.Property<string>("Settings")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique()
.HasFilter("[ClientId] IS NOT NULL");
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Scopes")
.HasColumnType("nvarchar(max)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("Descriptions")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Resources")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique()
.HasFilter("[Name] IS NOT NULL");
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("AuthorizationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("datetime2");
b.Property<string>("Payload")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("datetime2");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique()
.HasFilter("[ReferenceId] IS NOT NULL");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.CacheInstructionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("InstructionCount")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasDefaultValue(1)
.HasColumnName("instructionCount");
b.Property<string>("Instructions")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("jsonInstruction");
b.Property<string>("OriginIdentity")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasColumnName("originated");
b.Property<DateTime>("UtcStamp")
.HasColumnType("datetime2")
.HasColumnName("utcStamp");
b.HasKey("Id");
b.ToTable("umbracoCacheInstruction", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LastSyncedDto", b =>
{
b.Property<string>("MachineId")
.HasColumnType("nvarchar(450)")
.HasColumnName("machineId");
b.Property<DateTime>("LastSyncedDate")
.HasColumnType("datetime2")
.HasColumnName("lastSyncedDate");
b.Property<int?>("LastSyncedExternalId")
.HasColumnType("int");
b.Property<int?>("LastSyncedInternalId")
.HasColumnType("int")
.HasColumnName("lastSyncedInternalId");
b.HasKey("MachineId");
b.ToTable("umbracoLastSynced", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("nvarchar(255)")
.HasColumnName("event");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("nvarchar(450)")
.HasColumnName("Key");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasColumnType("nvarchar(max)")
.HasColumnName("description");
b.Property<bool>("Enabled")
.HasColumnType("bit")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("uniqueidentifier")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)")
.HasColumnName("name");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("url");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,22 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddLastSyncedDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// NO-OP
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,484 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260227114149_AddKeyValueDto")]
partial class AddKeyValueDto
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("ClientSecret")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("JsonWebKeySet")
.HasColumnType("nvarchar(max)");
b.Property<string>("Permissions")
.HasColumnType("nvarchar(max)");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("RedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Requirements")
.HasColumnType("nvarchar(max)");
b.Property<string>("Settings")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique()
.HasFilter("[ClientId] IS NOT NULL");
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Scopes")
.HasColumnType("nvarchar(max)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("Descriptions")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Resources")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique()
.HasFilter("[Name] IS NOT NULL");
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("AuthorizationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("datetime2");
b.Property<string>("Payload")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("datetime2");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique()
.HasFilter("[ReferenceId] IS NOT NULL");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.CacheInstructionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("InstructionCount")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasDefaultValue(1)
.HasColumnName("instructionCount");
b.Property<string>("Instructions")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("jsonInstruction");
b.Property<string>("OriginIdentity")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasColumnName("originated");
b.Property<DateTime>("UtcStamp")
.HasColumnType("datetime2")
.HasColumnName("utcStamp");
b.HasKey("Id");
b.ToTable("umbracoCacheInstruction", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.KeyValueDto", b =>
{
b.Property<string>("Key")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("key");
b.Property<DateTime>("UpdateDate")
.HasColumnType("datetime2")
.HasColumnName("updated");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)")
.HasColumnName("value");
b.HasKey("Key");
b.ToTable("umbracoKeyValue", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LastSyncedDto", b =>
{
b.Property<string>("MachineId")
.HasColumnType("nvarchar(450)")
.HasColumnName("machineId");
b.Property<DateTime>("LastSyncedDate")
.HasColumnType("datetime2")
.HasColumnName("lastSyncedDate");
b.Property<int?>("LastSyncedExternalId")
.HasColumnType("int");
b.Property<int?>("LastSyncedInternalId")
.HasColumnType("int")
.HasColumnName("lastSyncedInternalId");
b.HasKey("MachineId");
b.ToTable("umbracoLastSynced", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("nvarchar(255)")
.HasColumnName("event");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("nvarchar(450)")
.HasColumnName("Key");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasColumnType("nvarchar(max)")
.HasColumnName("description");
b.Property<bool>("Enabled")
.HasColumnType("bit")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("uniqueidentifier")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)")
.HasColumnName("name");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("url");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,22 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddKeyValueDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// NO-OP
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,547 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260323132759_AddLanguageDto")]
partial class AddLanguageDto
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("ClientSecret")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("JsonWebKeySet")
.HasColumnType("nvarchar(max)");
b.Property<string>("Permissions")
.HasColumnType("nvarchar(max)");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("RedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Requirements")
.HasColumnType("nvarchar(max)");
b.Property<string>("Settings")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique()
.HasFilter("[ClientId] IS NOT NULL");
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Scopes")
.HasColumnType("nvarchar(max)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("Descriptions")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Resources")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique()
.HasFilter("[Name] IS NOT NULL");
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("AuthorizationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("datetime2");
b.Property<string>("Payload")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("datetime2");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique()
.HasFilter("[ReferenceId] IS NOT NULL");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.CacheInstructionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("InstructionCount")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasDefaultValue(1)
.HasColumnName("instructionCount");
b.Property<string>("Instructions")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("jsonInstruction");
b.Property<string>("OriginIdentity")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasColumnName("originated");
b.Property<DateTime>("UtcStamp")
.HasColumnType("datetime2")
.HasColumnName("utcStamp");
b.HasKey("Id");
b.ToTable("umbracoCacheInstruction", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.KeyValueDto", b =>
{
b.Property<string>("Key")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("key");
b.Property<DateTime>("UpdateDate")
.HasColumnType("datetime2")
.HasColumnName("updated");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)")
.HasColumnName("value");
b.HasKey("Key");
b.ToTable("umbracoKeyValue", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("CultureName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)")
.HasColumnName("languageCultureName");
b.Property<int?>("FallbackLanguageId")
.HasColumnType("int")
.HasColumnName("fallbackLanguageId");
b.Property<bool>("IsDefault")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("isDefaultVariantLang");
b.Property<bool>("IsMandatory")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("mandatory");
b.Property<string>("IsoCode")
.HasMaxLength(14)
.HasColumnType("nvarchar(14)")
.HasColumnName("languageISOCode");
b.Property<Guid>("LanguageKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("languageKey");
b.HasKey("Id");
b.HasIndex("FallbackLanguageId");
b.HasIndex("IsoCode")
.IsUnique()
.HasFilter("[languageISOCode] IS NOT NULL");
b.HasIndex("LanguageKey")
.IsUnique();
b.ToTable("umbracoLanguage", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LastSyncedDto", b =>
{
b.Property<string>("MachineId")
.HasColumnType("nvarchar(450)")
.HasColumnName("machineId");
b.Property<DateTime>("LastSyncedDate")
.HasColumnType("datetime2")
.HasColumnName("lastSyncedDate");
b.Property<int?>("LastSyncedExternalId")
.HasColumnType("int");
b.Property<int?>("LastSyncedInternalId")
.HasColumnType("int")
.HasColumnName("lastSyncedInternalId");
b.HasKey("MachineId");
b.ToTable("umbracoLastSynced", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("nvarchar(255)")
.HasColumnName("event");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("nvarchar(450)")
.HasColumnName("Key");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasColumnType("nvarchar(max)")
.HasColumnName("description");
b.Property<bool>("Enabled")
.HasColumnType("bit")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("uniqueidentifier")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)")
.HasColumnName("name");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("url");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", "FallbackLanguage")
.WithMany()
.HasForeignKey("FallbackLanguageId")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("FallbackLanguage");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddLanguageDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,684 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260326120314_AddDomainDto")]
partial class AddDomainDto
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("ClientSecret")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("JsonWebKeySet")
.HasColumnType("nvarchar(max)");
b.Property<string>("Permissions")
.HasColumnType("nvarchar(max)");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("RedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Requirements")
.HasColumnType("nvarchar(max)");
b.Property<string>("Settings")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique()
.HasFilter("[ClientId] IS NOT NULL");
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Scopes")
.HasColumnType("nvarchar(max)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("Descriptions")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Resources")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique()
.HasFilter("[Name] IS NOT NULL");
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("AuthorizationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("datetime2");
b.Property<string>("Payload")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("datetime2");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique()
.HasFilter("[ReferenceId] IS NOT NULL");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.CacheInstructionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("InstructionCount")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasDefaultValue(1)
.HasColumnName("instructionCount");
b.Property<string>("Instructions")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("jsonInstruction");
b.Property<string>("OriginIdentity")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasColumnName("originated");
b.Property<DateTime>("UtcStamp")
.HasColumnType("datetime2")
.HasColumnName("utcStamp");
b.HasKey("Id");
b.ToTable("umbracoCacheInstruction", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.DomainDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("DefaultLanguage")
.HasColumnType("int")
.HasColumnName("domainDefaultLanguage");
b.Property<string>("DomainName")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("domainName");
b.Property<Guid>("Key")
.HasColumnType("uniqueidentifier")
.HasColumnName("key");
b.Property<int?>("RootStructureId")
.HasColumnType("int")
.HasColumnName("domainRootStructureID");
b.Property<int>("SortOrder")
.HasColumnType("int")
.HasColumnName("sortOrder");
b.HasKey("Id");
b.HasIndex("Key")
.IsUnique();
b.ToTable("umbracoDomain", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.KeyValueDto", b =>
{
b.Property<string>("Key")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("key");
b.Property<DateTime>("UpdateDate")
.HasColumnType("datetime2")
.HasColumnName("updated");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)")
.HasColumnName("value");
b.HasKey("Key");
b.ToTable("umbracoKeyValue", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("CultureName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)")
.HasColumnName("languageCultureName");
b.Property<int?>("FallbackLanguageId")
.HasColumnType("int")
.HasColumnName("fallbackLanguageId");
b.Property<bool>("IsDefault")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("isDefaultVariantLang");
b.Property<bool>("IsMandatory")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("mandatory");
b.Property<string>("IsoCode")
.HasMaxLength(14)
.HasColumnType("nvarchar(14)")
.HasColumnName("languageISOCode");
b.Property<Guid>("LanguageKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("languageKey");
b.HasKey("Id");
b.HasIndex("FallbackLanguageId");
b.HasIndex("IsoCode")
.IsUnique()
.HasFilter("[languageISOCode] IS NOT NULL");
b.HasIndex("LanguageKey")
.IsUnique();
b.ToTable("umbracoLanguage", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LastSyncedDto", b =>
{
b.Property<string>("MachineId")
.HasColumnType("nvarchar(450)")
.HasColumnName("machineId");
b.Property<DateTime>("LastSyncedDate")
.HasColumnType("datetime2")
.HasColumnName("lastSyncedDate");
b.Property<int?>("LastSyncedExternalId")
.HasColumnType("int");
b.Property<int?>("LastSyncedInternalId")
.HasColumnType("int")
.HasColumnName("lastSyncedInternalId");
b.HasKey("MachineId");
b.ToTable("umbracoLastSynced", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", b =>
{
b.Property<int>("NodeId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("NodeId"));
b.Property<DateTime>("CreateDate")
.HasColumnType("datetime2")
.HasColumnName("createDate");
b.Property<short>("Level")
.HasColumnType("smallint")
.HasColumnName("level");
b.Property<Guid?>("NodeObjectType")
.HasColumnType("uniqueidentifier")
.HasColumnName("nodeObjectType");
b.Property<int>("ParentId")
.HasColumnType("int")
.HasColumnName("parentId");
b.Property<string>("Path")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("nvarchar(150)")
.HasColumnName("path");
b.Property<int>("SortOrder")
.HasColumnType("int")
.HasColumnName("sortOrder");
b.Property<string>("Text")
.HasColumnType("nvarchar(max)")
.HasColumnName("text");
b.Property<bool>("Trashed")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("trashed");
b.Property<Guid>("UniqueId")
.HasColumnType("uniqueidentifier")
.HasColumnName("uniqueId");
b.Property<int?>("UserId")
.HasColumnType("int")
.HasColumnName("nodeUser");
b.HasKey("NodeId");
b.HasIndex("Path")
.HasDatabaseName("IX_umbracoNode_Path");
b.HasIndex("Trashed")
.HasDatabaseName("IX_umbracoNode_Trashed");
b.HasIndex("UniqueId")
.IsUnique()
.HasDatabaseName("IX_umbracoNode_UniqueId");
SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("UniqueId"), new[] { "ParentId", "Level", "Path", "SortOrder", "Trashed", "UserId", "Text", "CreateDate" });
b.HasIndex("NodeObjectType", "Trashed")
.HasDatabaseName("IX_umbracoNode_ObjectType");
SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("NodeObjectType", "Trashed"), new[] { "UniqueId", "ParentId", "Level", "Path", "SortOrder", "UserId", "Text", "CreateDate" });
b.HasIndex("ParentId", "NodeObjectType")
.HasDatabaseName("IX_umbracoNode_parentId_nodeObjectType");
SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("ParentId", "NodeObjectType"), new[] { "Trashed", "UserId", "Level", "Path", "SortOrder", "UniqueId", "Text", "CreateDate" });
b.HasIndex("NodeObjectType", "Trashed", "SortOrder", "NodeId")
.HasDatabaseName("IX_umbracoNode_ObjectType_trashed_sorted");
SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("NodeObjectType", "Trashed", "SortOrder", "NodeId"), new[] { "UniqueId", "ParentId", "Level", "Path", "UserId", "Text", "CreateDate" });
b.HasIndex("Level", "ParentId", "SortOrder", "NodeObjectType", "Trashed")
.HasDatabaseName("IX_umbracoNode_Level");
SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Level", "ParentId", "SortOrder", "NodeObjectType", "Trashed"), new[] { "UserId", "Path", "UniqueId", "CreateDate" });
b.ToTable("umbracoNode", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("nvarchar(255)")
.HasColumnName("event");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("nvarchar(450)")
.HasColumnName("Key");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasColumnType("nvarchar(max)")
.HasColumnName("description");
b.Property<bool>("Enabled")
.HasColumnType("bit")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("uniqueidentifier")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)")
.HasColumnName("name");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("url");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", "FallbackLanguage")
.WithMany()
.HasForeignKey("FallbackLanguageId")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("FallbackLanguage");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", null)
.WithMany()
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddDomainDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,916 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260430105003_AddAuditDtos")]
partial class AddAuditDtos
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("ClientSecret")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("JsonWebKeySet")
.HasColumnType("nvarchar(max)");
b.Property<string>("Permissions")
.HasColumnType("nvarchar(max)");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("RedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Requirements")
.HasColumnType("nvarchar(max)");
b.Property<string>("Settings")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique()
.HasFilter("[ClientId] IS NOT NULL");
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Scopes")
.HasColumnType("nvarchar(max)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("Descriptions")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Resources")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique()
.HasFilter("[Name] IS NOT NULL");
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("AuthorizationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("datetime2");
b.Property<string>("Payload")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("datetime2");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique()
.HasFilter("[ReferenceId] IS NOT NULL");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.AuditEntryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AffectedDetails")
.HasMaxLength(1024)
.HasColumnType("nvarchar(1024)")
.HasColumnName("affectedDetails");
b.Property<int>("AffectedUserId")
.HasColumnType("int")
.HasColumnName("affectedUserId");
b.Property<Guid?>("AffectedUserKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("affectedUserKey");
b.Property<DateTime>("EventDate")
.HasColumnType("datetime2")
.HasColumnName("eventDateUtc");
b.Property<string>("EventDetails")
.HasMaxLength(1024)
.HasColumnType("nvarchar(1024)")
.HasColumnName("eventDetails");
b.Property<string>("EventType")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("eventType");
b.Property<string>("PerformingDetails")
.HasMaxLength(1024)
.HasColumnType("nvarchar(1024)")
.HasColumnName("performingDetails");
b.Property<string>("PerformingIp")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)")
.HasColumnName("performingIp");
b.Property<int>("PerformingUserId")
.HasColumnType("int")
.HasColumnName("performingUserId");
b.Property<Guid?>("PerformingUserKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("performingUserKey");
b.HasKey("Id");
b.ToTable("umbracoAudit", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.CacheInstructionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("InstructionCount")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasDefaultValue(1)
.HasColumnName("instructionCount");
b.Property<string>("Instructions")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("jsonInstruction");
b.Property<string>("OriginIdentity")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasColumnName("originated");
b.Property<DateTime>("UtcStamp")
.HasColumnType("datetime2")
.HasColumnName("utcStamp");
b.HasKey("Id");
b.ToTable("umbracoCacheInstruction", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.DomainDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("DefaultLanguage")
.HasColumnType("int")
.HasColumnName("domainDefaultLanguage");
b.Property<string>("DomainName")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("domainName");
b.Property<Guid>("Key")
.HasColumnType("uniqueidentifier")
.HasColumnName("key");
b.Property<int?>("RootStructureId")
.HasColumnType("int")
.HasColumnName("domainRootStructureID");
b.Property<int>("SortOrder")
.HasColumnType("int")
.HasColumnName("sortOrder");
b.HasKey("Id");
b.HasIndex("Key")
.IsUnique();
b.ToTable("umbracoDomain", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.KeyValueDto", b =>
{
b.Property<string>("Key")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("key");
b.Property<DateTime>("UpdateDate")
.HasColumnType("datetime2")
.HasColumnName("updated");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)")
.HasColumnName("value");
b.HasKey("Key");
b.ToTable("umbracoKeyValue", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("CultureName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)")
.HasColumnName("languageCultureName");
b.Property<int?>("FallbackLanguageId")
.HasColumnType("int")
.HasColumnName("fallbackLanguageId");
b.Property<bool>("IsDefault")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("isDefaultVariantLang");
b.Property<bool>("IsMandatory")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("mandatory");
b.Property<string>("IsoCode")
.HasMaxLength(14)
.HasColumnType("nvarchar(14)")
.HasColumnName("languageISOCode");
b.Property<Guid>("LanguageKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("languageKey");
b.HasKey("Id");
b.HasIndex("FallbackLanguageId");
b.HasIndex("IsoCode")
.IsUnique()
.HasFilter("[languageISOCode] IS NOT NULL");
b.HasIndex("LanguageKey")
.IsUnique();
b.ToTable("umbracoLanguage", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LastSyncedDto", b =>
{
b.Property<string>("MachineId")
.HasColumnType("nvarchar(450)")
.HasColumnName("machineId");
b.Property<DateTime>("LastSyncedDate")
.HasColumnType("datetime2")
.HasColumnName("lastSyncedDate");
b.Property<int?>("LastSyncedExternalId")
.HasColumnType("int");
b.Property<int?>("LastSyncedInternalId")
.HasColumnType("int")
.HasColumnName("lastSyncedInternalId");
b.HasKey("MachineId");
b.ToTable("umbracoLastSynced", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LogDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Comment")
.HasMaxLength(4000)
.HasColumnType("nvarchar(4000)")
.HasColumnName("logComment");
b.Property<DateTime>("Datestamp")
.HasColumnType("datetime2")
.HasColumnName("Datestamp");
b.Property<string>("EntityType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)")
.HasColumnName("entityType");
b.Property<string>("Header")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)")
.HasColumnName("logHeader");
b.Property<int>("NodeId")
.HasColumnType("int")
.HasColumnName("NodeId");
b.Property<string>("Parameters")
.HasMaxLength(4000)
.HasColumnType("nvarchar(4000)")
.HasColumnName("parameters");
b.Property<int?>("UserId")
.HasColumnType("int")
.HasColumnName("userId");
b.HasKey("Id");
b.HasIndex("NodeId")
.HasDatabaseName("IX_umbracoLog");
b.HasIndex("UserId");
b.HasIndex("Datestamp", "Header")
.HasDatabaseName("IX_umbracoLog_datestamp_logheader");
b.HasIndex("Datestamp", "UserId", "NodeId")
.HasDatabaseName("IX_umbracoLog_datestamp");
b.ToTable("umbracoLog", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", b =>
{
b.Property<int>("NodeId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("NodeId"));
b.Property<DateTime>("CreateDate")
.HasColumnType("datetime2")
.HasColumnName("createDate");
b.Property<short>("Level")
.HasColumnType("smallint")
.HasColumnName("level");
b.Property<Guid?>("NodeObjectType")
.HasColumnType("uniqueidentifier")
.HasColumnName("nodeObjectType");
b.Property<int>("ParentId")
.HasColumnType("int")
.HasColumnName("parentId");
b.Property<string>("Path")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("nvarchar(150)")
.HasColumnName("path");
b.Property<int>("SortOrder")
.HasColumnType("int")
.HasColumnName("sortOrder");
b.Property<string>("Text")
.HasColumnType("nvarchar(max)")
.HasColumnName("text");
b.Property<bool>("Trashed")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("trashed");
b.Property<Guid>("UniqueId")
.HasColumnType("uniqueidentifier")
.HasColumnName("uniqueId");
b.Property<int?>("UserId")
.HasColumnType("int")
.HasColumnName("nodeUser");
b.HasKey("NodeId");
b.HasIndex("Path")
.HasDatabaseName("IX_umbracoNode_Path");
b.HasIndex("Trashed")
.HasDatabaseName("IX_umbracoNode_Trashed");
b.HasIndex("UniqueId")
.IsUnique()
.HasDatabaseName("IX_umbracoNode_UniqueId");
b.HasIndex("NodeObjectType", "Trashed")
.HasDatabaseName("IX_umbracoNode_ObjectType");
b.HasIndex("ParentId", "NodeObjectType")
.HasDatabaseName("IX_umbracoNode_parentId_nodeObjectType");
b.HasIndex("NodeObjectType", "Trashed", "SortOrder", "NodeId")
.HasDatabaseName("IX_umbracoNode_ObjectType_trashed_sorted");
b.HasIndex("Level", "ParentId", "SortOrder", "NodeObjectType", "Trashed")
.HasDatabaseName("IX_umbracoNode_Level");
b.ToTable("umbracoNode", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Avatar")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasColumnName("avatar");
b.Property<DateTime>("CreateDate")
.HasColumnType("datetime2")
.HasColumnName("createDate");
b.Property<bool>("Disabled")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("userDisabled");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("userEmail");
b.Property<DateTime?>("EmailConfirmedDate")
.HasColumnType("datetime2")
.HasColumnName("emailConfirmedDate");
b.Property<int?>("FailedLoginAttempts")
.HasColumnType("int")
.HasColumnName("failedLoginAttempts");
b.Property<DateTime?>("InvitedDate")
.HasColumnType("datetime2")
.HasColumnName("invitedDate");
b.Property<Guid>("Key")
.HasColumnType("uniqueidentifier")
.HasColumnName("key");
b.Property<short>("Kind")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValue((short)0)
.HasColumnName("kind");
b.Property<DateTime?>("LastLockoutDate")
.HasColumnType("datetime2")
.HasColumnName("lastLockoutDate");
b.Property<DateTime?>("LastLoginDate")
.HasColumnType("datetime2")
.HasColumnName("lastLoginDate");
b.Property<DateTime?>("LastPasswordChangeDate")
.HasColumnType("datetime2")
.HasColumnName("lastPasswordChangeDate");
b.Property<string>("Login")
.HasMaxLength(125)
.HasColumnType("nvarchar(125)")
.HasColumnName("userLogin");
b.Property<bool>("NoConsole")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("userNoConsole");
b.Property<string>("Password")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasColumnName("userPassword");
b.Property<string>("PasswordConfig")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasColumnName("passwordConfig");
b.Property<string>("SecurityStampToken")
.HasMaxLength(255)
.HasColumnType("nvarchar(255)")
.HasColumnName("securityStampToken");
b.Property<DateTime>("UpdateDate")
.HasColumnType("datetime2")
.HasColumnName("updateDate");
b.Property<string>("UserLanguage")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)")
.HasColumnName("userLanguage");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("userName");
b.HasKey("Id")
.HasName("PK_user");
b.HasIndex("Key")
.IsUnique()
.HasDatabaseName("IX_umbracoUser_userKey");
b.HasIndex("Login");
b.ToTable("umbracoUser", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("nvarchar(255)")
.HasColumnName("event");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("nvarchar(450)")
.HasColumnName("Key");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasColumnType("nvarchar(max)")
.HasColumnName("description");
b.Property<bool>("Enabled")
.HasColumnType("bit")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("uniqueidentifier")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)")
.HasColumnName("name");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("url");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", "FallbackLanguage")
.WithMany()
.HasForeignKey("FallbackLanguageId")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("FallbackLanguage");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LogDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.UserDto", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("User");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", null)
.WithMany()
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddAuditDtos : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddRelationDtos : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,956 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260515075837_AddLongRunningOperationDto")]
partial class AddLongRunningOperationDto
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("ClientSecret")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("JsonWebKeySet")
.HasColumnType("nvarchar(max)");
b.Property<string>("Permissions")
.HasColumnType("nvarchar(max)");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("RedirectUris")
.HasColumnType("nvarchar(max)");
b.Property<string>("Requirements")
.HasColumnType("nvarchar(max)");
b.Property<string>("Settings")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique()
.HasFilter("[ClientId] IS NOT NULL");
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Scopes")
.HasColumnType("nvarchar(max)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("Descriptions")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayNames")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Resources")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique()
.HasFilter("[Name] IS NOT NULL");
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ApplicationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("AuthorizationId")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime?>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("datetime2");
b.Property<string>("Payload")
.HasColumnType("nvarchar(max)");
b.Property<string>("Properties")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("datetime2");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique()
.HasFilter("[ReferenceId] IS NOT NULL");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.AuditEntryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AffectedDetails")
.HasMaxLength(1024)
.HasColumnType("nvarchar(1024)")
.HasColumnName("affectedDetails");
b.Property<int>("AffectedUserId")
.HasColumnType("int")
.HasColumnName("affectedUserId");
b.Property<Guid?>("AffectedUserKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("affectedUserKey");
b.Property<DateTime>("EventDate")
.HasColumnType("datetime2")
.HasColumnName("eventDateUtc");
b.Property<string>("EventDetails")
.HasMaxLength(1024)
.HasColumnType("nvarchar(1024)")
.HasColumnName("eventDetails");
b.Property<string>("EventType")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("eventType");
b.Property<string>("PerformingDetails")
.HasMaxLength(1024)
.HasColumnType("nvarchar(1024)")
.HasColumnName("performingDetails");
b.Property<string>("PerformingIp")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)")
.HasColumnName("performingIp");
b.Property<int>("PerformingUserId")
.HasColumnType("int")
.HasColumnName("performingUserId");
b.Property<Guid?>("PerformingUserKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("performingUserKey");
b.HasKey("Id");
b.ToTable("umbracoAudit", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.CacheInstructionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("InstructionCount")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasDefaultValue(1)
.HasColumnName("instructionCount");
b.Property<string>("Instructions")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("jsonInstruction");
b.Property<string>("OriginIdentity")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasColumnName("originated");
b.Property<DateTime>("UtcStamp")
.HasColumnType("datetime2")
.HasColumnName("utcStamp");
b.HasKey("Id");
b.ToTable("umbracoCacheInstruction", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.DomainDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("DefaultLanguage")
.HasColumnType("int")
.HasColumnName("domainDefaultLanguage");
b.Property<string>("DomainName")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("domainName");
b.Property<Guid>("Key")
.HasColumnType("uniqueidentifier")
.HasColumnName("key");
b.Property<int?>("RootStructureId")
.HasColumnType("int")
.HasColumnName("domainRootStructureID");
b.Property<int>("SortOrder")
.HasColumnType("int")
.HasColumnName("sortOrder");
b.HasKey("Id");
b.HasIndex("Key")
.IsUnique();
b.ToTable("umbracoDomain", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.KeyValueDto", b =>
{
b.Property<string>("Key")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("key");
b.Property<DateTime>("UpdateDate")
.HasColumnType("datetime2")
.HasColumnName("updated");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)")
.HasColumnName("value");
b.HasKey("Key");
b.ToTable("umbracoKeyValue", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("CultureName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)")
.HasColumnName("languageCultureName");
b.Property<int?>("FallbackLanguageId")
.HasColumnType("int")
.HasColumnName("fallbackLanguageId");
b.Property<bool>("IsDefault")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("isDefaultVariantLang");
b.Property<bool>("IsMandatory")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("mandatory");
b.Property<string>("IsoCode")
.HasMaxLength(14)
.HasColumnType("nvarchar(14)")
.HasColumnName("languageISOCode");
b.Property<Guid>("LanguageKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("languageKey");
b.HasKey("Id");
b.HasIndex("FallbackLanguageId");
b.HasIndex("IsoCode")
.IsUnique()
.HasFilter("[languageISOCode] IS NOT NULL");
b.HasIndex("LanguageKey")
.IsUnique();
b.ToTable("umbracoLanguage", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LastSyncedDto", b =>
{
b.Property<string>("MachineId")
.HasColumnType("nvarchar(450)")
.HasColumnName("machineId");
b.Property<DateTime>("LastSyncedDate")
.HasColumnType("datetime2")
.HasColumnName("lastSyncedDate");
b.Property<int?>("LastSyncedExternalId")
.HasColumnType("int");
b.Property<int?>("LastSyncedInternalId")
.HasColumnType("int")
.HasColumnName("lastSyncedInternalId");
b.HasKey("MachineId");
b.ToTable("umbracoLastSynced", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LogDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Comment")
.HasMaxLength(4000)
.HasColumnType("nvarchar(4000)")
.HasColumnName("logComment");
b.Property<DateTime>("Datestamp")
.HasColumnType("datetime2")
.HasColumnName("Datestamp");
b.Property<string>("EntityType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)")
.HasColumnName("entityType");
b.Property<string>("Header")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)")
.HasColumnName("logHeader");
b.Property<int>("NodeId")
.HasColumnType("int")
.HasColumnName("NodeId");
b.Property<string>("Parameters")
.HasMaxLength(4000)
.HasColumnType("nvarchar(4000)")
.HasColumnName("parameters");
b.Property<int?>("UserId")
.HasColumnType("int")
.HasColumnName("userId");
b.HasKey("Id");
b.HasIndex("NodeId")
.HasDatabaseName("IX_umbracoLog");
b.HasIndex("UserId");
b.HasIndex("Datestamp", "Header")
.HasDatabaseName("IX_umbracoLog_datestamp_logheader");
b.HasIndex("Datestamp", "UserId", "NodeId")
.HasDatabaseName("IX_umbracoLog_datestamp");
b.ToTable("umbracoLog", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LongRunningOperationDto", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier")
.HasColumnName("id");
b.Property<DateTime>("CreateDate")
.HasColumnType("datetime2")
.HasColumnName("createDate");
b.Property<DateTime>("ExpirationDate")
.HasColumnType("datetime2")
.HasColumnName("expirationDate");
b.Property<string>("Result")
.HasColumnType("nvarchar(max)")
.HasColumnName("result");
b.Property<string>("Status")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)")
.HasColumnName("status");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("nvarchar(200)")
.HasColumnName("type");
b.Property<DateTime>("UpdateDate")
.HasColumnType("datetime2")
.HasColumnName("updateDate");
b.HasKey("Id")
.HasName("PK_umbracoLongRunningOperation");
b.ToTable("umbracoLongRunningOperation", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", b =>
{
b.Property<int>("NodeId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("NodeId"));
b.Property<DateTime>("CreateDate")
.HasColumnType("datetime2")
.HasColumnName("createDate");
b.Property<short>("Level")
.HasColumnType("smallint")
.HasColumnName("level");
b.Property<Guid?>("NodeObjectType")
.HasColumnType("uniqueidentifier")
.HasColumnName("nodeObjectType");
b.Property<int>("ParentId")
.HasColumnType("int")
.HasColumnName("parentId");
b.Property<string>("Path")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("nvarchar(150)")
.HasColumnName("path");
b.Property<int>("SortOrder")
.HasColumnType("int")
.HasColumnName("sortOrder");
b.Property<string>("Text")
.HasColumnType("nvarchar(max)")
.HasColumnName("text");
b.Property<bool>("Trashed")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("trashed");
b.Property<Guid>("UniqueId")
.HasColumnType("uniqueidentifier")
.HasColumnName("uniqueId");
b.Property<int?>("UserId")
.HasColumnType("int")
.HasColumnName("nodeUser");
b.HasKey("NodeId");
b.HasIndex("Path")
.HasDatabaseName("IX_umbracoNode_Path");
b.HasIndex("Trashed")
.HasDatabaseName("IX_umbracoNode_Trashed");
b.HasIndex("UniqueId")
.IsUnique()
.HasDatabaseName("IX_umbracoNode_UniqueId");
b.HasIndex("NodeObjectType", "Trashed")
.HasDatabaseName("IX_umbracoNode_ObjectType");
b.HasIndex("ParentId", "NodeObjectType")
.HasDatabaseName("IX_umbracoNode_parentId_nodeObjectType");
b.HasIndex("NodeObjectType", "Trashed", "SortOrder", "NodeId")
.HasDatabaseName("IX_umbracoNode_ObjectType_trashed_sorted");
b.HasIndex("Level", "ParentId", "SortOrder", "NodeObjectType", "Trashed")
.HasDatabaseName("IX_umbracoNode_Level");
b.ToTable("umbracoNode", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Avatar")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasColumnName("avatar");
b.Property<DateTime>("CreateDate")
.HasColumnType("datetime2")
.HasColumnName("createDate");
b.Property<bool>("Disabled")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("userDisabled");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("userEmail");
b.Property<DateTime?>("EmailConfirmedDate")
.HasColumnType("datetime2")
.HasColumnName("emailConfirmedDate");
b.Property<int?>("FailedLoginAttempts")
.HasColumnType("int")
.HasColumnName("failedLoginAttempts");
b.Property<DateTime?>("InvitedDate")
.HasColumnType("datetime2")
.HasColumnName("invitedDate");
b.Property<Guid>("Key")
.HasColumnType("uniqueidentifier")
.HasColumnName("key");
b.Property<short>("Kind")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValue((short)0)
.HasColumnName("kind");
b.Property<DateTime?>("LastLockoutDate")
.HasColumnType("datetime2")
.HasColumnName("lastLockoutDate");
b.Property<DateTime?>("LastLoginDate")
.HasColumnType("datetime2")
.HasColumnName("lastLoginDate");
b.Property<DateTime?>("LastPasswordChangeDate")
.HasColumnType("datetime2")
.HasColumnName("lastPasswordChangeDate");
b.Property<string>("Login")
.HasMaxLength(125)
.HasColumnType("nvarchar(125)")
.HasColumnName("userLogin");
b.Property<bool>("NoConsole")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("userNoConsole");
b.Property<string>("Password")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasColumnName("userPassword");
b.Property<string>("PasswordConfig")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasColumnName("passwordConfig");
b.Property<string>("SecurityStampToken")
.HasMaxLength(255)
.HasColumnType("nvarchar(255)")
.HasColumnName("securityStampToken");
b.Property<DateTime>("UpdateDate")
.HasColumnType("datetime2")
.HasColumnName("updateDate");
b.Property<string>("UserLanguage")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)")
.HasColumnName("userLanguage");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("userName");
b.HasKey("Id")
.HasName("PK_user");
b.HasIndex("Key")
.IsUnique()
.HasDatabaseName("IX_umbracoUser_userKey");
b.HasIndex("Login");
b.ToTable("umbracoUser", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("uniqueidentifier")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("nvarchar(255)")
.HasColumnName("event");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("int")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("nvarchar(450)")
.HasColumnName("Key");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasColumnType("nvarchar(max)")
.HasColumnName("description");
b.Property<bool>("Enabled")
.HasColumnType("bit")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("uniqueidentifier")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)")
.HasColumnName("name");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("url");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", "FallbackLanguage")
.WithMany()
.HasForeignKey("FallbackLanguageId")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("FallbackLanguage");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LogDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.UserDto", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("User");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", null)
.WithMany()
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddLongRunningOperationDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddContentVersionCleanupPolicyDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,23 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddPublicAccessDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// NO-OP to satisfy EF Core
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
// NO-OP to satisfy EF Core
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddDistributedJobDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddConsentDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddContentTypeDtos : Migration
{
// The tables already exist (they are created by the NPoco schema installer); this migration only
// updates the EF Core model snapshot.
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,20 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations
{
/// <inheritdoc />
public partial class AddDictionaryDtos : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,19 @@
using Microsoft.EntityFrameworkCore;
using Umbraco.Cms.Core;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
namespace Umbraco.Cms.Persistence.EFCore.SqlServer;
/// <summary>
/// Configures the <see cref="DbContextOptionsBuilder"/> to use SQL Server as the database provider.
/// </summary>
public class SqlServerDatabaseConfigurator : IDatabaseConfigurator
{
/// <inheritdoc />
public bool CanHandle(string providerName)
=> string.Equals(providerName, Constants.ProviderNames.SQLServer, StringComparison.OrdinalIgnoreCase);
/// <inheritdoc />
public void Configure(DbContextOptionsBuilder builder, string connectionString)
=> builder.UseSqlServer(connectionString);
}
@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DistributedLocking;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
using Umbraco.Cms.Infrastructure.Persistence.EFCore.Locking;
namespace Umbraco.Cms.Persistence.EFCore.SqlServer;
/// <summary>
/// Registers SQL Server-specific services for a given <see cref="DbContext"/> type.
/// </summary>
public class SqlServerDbContextServiceRegistrar : IDbContextServiceRegistrar
{
/// <inheritdoc />
public bool CanHandle(string providerName)
=> string.Equals(providerName, Constants.ProviderNames.SQLServer, StringComparison.OrdinalIgnoreCase);
/// <inheritdoc />
public void RegisterServices<TContext>(IServiceCollection services)
where TContext : DbContext
=> services.AddSingleton<IDistributedLockingMechanism, SqlServerEFCoreDistributedLockingMechanism<TContext>>();
}
@@ -8,16 +8,17 @@ using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DistributedLocking;
using Umbraco.Cms.Core.DistributedLocking.Exceptions;
using Umbraco.Cms.Core.Exceptions;
using Umbraco.Cms.Persistence.EFCore.Scoping;
using Umbraco.Cms.Infrastructure.Persistence.EFCore.Extensions;
using Umbraco.Cms.Infrastructure.Persistence.EFCore.Scoping;
using Umbraco.Extensions;
namespace Umbraco.Cms.Persistence.EFCore.Locking;
namespace Umbraco.Cms.Infrastructure.Persistence.EFCore.Locking;
/// <summary>
/// Implements distributed locking for SQL Server databases using EF Core.
/// </summary>
/// <typeparam name="T">The type of DbContext.</typeparam>
internal sealed class SqlServerEFCoreDistributedLockingMechanism<T> : IDistributedLockingMechanism
public sealed class SqlServerEFCoreDistributedLockingMechanism<T> : IDistributedLockingMechanism
where T : DbContext
{
private ConnectionStrings _connectionStrings;
@@ -47,7 +48,8 @@ internal sealed class SqlServerEFCoreDistributedLockingMechanism<T> : IDistribut
/// <inheritdoc />
public bool Enabled => _connectionStrings.IsConnectionStringConfigured() &&
string.Equals(_connectionStrings.ProviderName, "Microsoft.Data.SqlClient", StringComparison.InvariantCultureIgnoreCase) && _scopeAccessor.Value.AmbientScope is not null;
string.Equals(_connectionStrings.ProviderName, "Microsoft.Data.SqlClient", StringComparison.InvariantCultureIgnoreCase) &&
_scopeAccessor.Value.HasBridgedAmbientScope is false;
/// <inheritdoc />
public IDistributedLock ReadLock(int lockId, TimeSpan? obtainLockTimeout = null)
@@ -1,6 +1,9 @@
using Microsoft.EntityFrameworkCore;
using Umbraco.Cms.Core;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
using Umbraco.Cms.Infrastructure.Persistence.EFCore.Extensions;
using Umbraco.Cms.Infrastructure.Persistence.EFCore.Migrations;
using Umbraco.Cms.Persistence.EFCore.Migrations;
using Umbraco.Extensions;
namespace Umbraco.Cms.Persistence.EFCore.SqlServer;
@@ -23,8 +26,14 @@ public class SqlServerMigrationProvider : IMigrationProvider
/// <inheritdoc />
public async Task MigrateAsync(EFCoreMigration migration)
{
Type? migrationType = GetMigrationType(migration);
if (migrationType is null)
{
return;
}
UmbracoDbContext context = await _dbContextFactory.CreateDbContextAsync();
await context.MigrateDatabaseAsync(GetMigrationType(migration));
await context.MigrateDatabaseAsync(migrationType);
}
/// <inheritdoc />
@@ -34,13 +43,28 @@ public class SqlServerMigrationProvider : IMigrationProvider
await context.Database.MigrateAsync();
}
private static Type GetMigrationType(EFCoreMigration migration) =>
private static Type? GetMigrationType(EFCoreMigration migration) =>
migration switch
{
EFCoreMigration.InitialCreate => typeof(Migrations.InitialCreate),
EFCoreMigration.AddOpenIddict => typeof(Migrations.AddOpenIddict),
EFCoreMigration.UpdateOpenIddictToV5 => typeof(Migrations.UpdateOpenIddictToV5),
EFCoreMigration.UpdateOpenIddictToV7 => typeof(Migrations.UpdateOpenIddictToV7),
EFCoreMigration.AddWebhookDto => typeof(Migrations.AddWebhookDto),
EFCoreMigration.AddLastSyncedDto => typeof(Migrations.AddLastSyncedDto),
EFCoreMigration.AddKeyValueDto => typeof(Migrations.AddKeyValueDto),
EFCoreMigration.SqliteCollation => null, // SQLite-only migration, no-op on SQL Server
EFCoreMigration.AddLanguageDto => typeof(Migrations.AddLanguageDto),
EFCoreMigration.AddDomainDto => typeof(Migrations.AddDomainDto),
EFCoreMigration.AddAuditDtos => typeof(Migrations.AddAuditDtos),
EFCoreMigration.AddLongRunningOperationDto => typeof(Migrations.AddLongRunningOperationDto),
EFCoreMigration.AddRelationDtos => typeof(Migrations.AddRelationDtos),
EFCoreMigration.AddContentVersionCleanupPolicyDto => typeof(Migrations.AddContentVersionCleanupPolicyDto),
EFCoreMigration.AddPublicAccessDto => typeof(Migrations.AddPublicAccessDto),
EFCoreMigration.AddDistributedJobDto => typeof(Migrations.AddDistributedJobDto),
EFCoreMigration.AddConsentDto => typeof(Migrations.AddConsentDto),
EFCoreMigration.AddDictionaryDto => typeof(Migrations.AddDictionaryDtos),
EFCoreMigration.AddContentTypeDtos => typeof(Migrations.AddContentTypeDtos),
_ => throw new ArgumentOutOfRangeException(nameof(migration), $@"Not expected migration value: {migration}")
};
}
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Umbraco.Cms.Core;
using Umbraco.Cms.Persistence.EFCore.Migrations;
using Umbraco.Cms.Infrastructure.Persistence.EFCore.Migrations;
namespace Umbraco.Cms.Persistence.EFCore.SqlServer;
@@ -9,6 +9,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Cms.Persistence.EFCore\Umbraco.Cms.Persistence.EFCore.csproj" />
<ProjectReference Include="..\Umbraco.Infrastructure\Umbraco.Infrastructure.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,35 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
using Umbraco.Cms.Infrastructure.Persistence.EFCore.Migrations;
using Umbraco.Cms.Persistence.EFCore.Migrations;
using Umbraco.Cms.Persistence.EFCore.SqlServer.DtoCustomization;
using Umbraco.Extensions;
namespace Umbraco.Cms.Persistence.EFCore.SqlServer;
/// <summary>
/// SQL Server EF Core support extensions for <see cref="IUmbracoBuilder"/>.
/// </summary>
public static class UmbracoBuilderExtensions
{
/// <summary>
/// Add required services for SQL Server EF Core support.
/// </summary>
public static IUmbracoBuilder AddUmbracoEFCoreSqlServerSupport(this IUmbracoBuilder builder)
{
builder.Services.AddSingleton<IMigrationProvider, SqlServerMigrationProvider>();
builder.Services.AddSingleton<IMigrationProviderSetup, SqlServerMigrationProviderSetup>();
builder.Services.AddSingleton<IDatabaseConfigurator, SqlServerDatabaseConfigurator>();
builder.AddDbContextRegistrar<SqlServerDbContextServiceRegistrar>();
AddCustomizers(builder);
return builder;
}
private static void AddCustomizers(IUmbracoBuilder builder) =>
builder.AddEFCoreModelCustomizer<SqlServerNodeDtoModelCustomizer>();
}
@@ -1,10 +1,10 @@
# Umbraco.Cms.Persistence.EFCore.Sqlite
SQLite-specific EF Core provider for Umbraco CMS. Contains SQLite migrations and provider setup for the EF Core persistence layer.
SQLite-specific EF Core provider for Umbraco CMS. Implements SQLite database configuration, distributed locking, migrations, and service registration for the EF Core persistence layer.
**Project Type**: Class Library (NuGet package)
**Target Framework**: net10.0
**Dependencies**: Umbraco.Cms.Persistence.EFCore
**Dependencies**: Umbraco.Infrastructure
---
@@ -12,12 +12,15 @@ SQLite-specific EF Core provider for Umbraco CMS. Contains SQLite migrations and
### Project Purpose
This is a thin provider project that implements SQLite-specific functionality for the EF Core persistence layer:
This provider project implements SQLite-specific functionality for the EF Core persistence layer:
1. **Migration Provider** - Executes SQLite-specific migrations
2. **Migration Provider Setup** - Configures DbContext to use SQLite (incl. transient-error retry)
3. **Migrations** - SQLite-specific migration files for OpenIddict tables
4. **Retrying Execution Strategy** - Retries transient SQLite lock errors on EF Core operations
1. **Database Configurator** - Configures DbContext with SQLite-specific options (`IDatabaseConfigurator`)
2. **Service Registrar** - Registers SQLite-specific services like distributed locking (`IDbContextServiceRegistrar`)
3. **Distributed Locking** - SQLite-specific distributed locking mechanism
4. **Migration Provider** - Executes SQLite-specific EF Core migrations
5. **Migration Provider Setup** - Configures DbContext to use SQLite for migrations
6. **Migrations** - SQLite-specific migration files (OpenIddict tables, webhooks, etc.)
7. **Retrying Execution Strategy** - Retries transient SQLite lock errors on EF Core operations
### Folder Structure
@@ -28,20 +31,28 @@ Umbraco.Cms.Persistence.EFCore.Sqlite/
│ ├── 20230807123456_AddOpenIddict.cs # OpenIddict tables
│ ├── 20240403141051_UpdateOpenIddictToV5.cs # OpenIddict v5 schema
│ ├── 20251006140958_UpdateOpenIddictToV7.cs # OpenIddict v7 (no-op for SQLite)
│ ├── 20260209100831_AddWebhookDto.cs # Webhook tables
│ └── UmbracoDbContextModelSnapshot.cs # Current model state
├── EFCoreSqliteComposer.cs # DI registration
├── SqliteCollationModelCustomizer.cs # Applies COLLATE NOCASE to all string properties
├── SqliteDatabaseConfigurator.cs # IDatabaseConfigurator impl
├── SqliteDbContextServiceRegistrar.cs # IDbContextServiceRegistrar impl
├── SqliteEFCoreDistributedLockingMechanism.cs # Distributed locking
├── SqliteMigrationProvider.cs # IMigrationProvider impl
├── SqliteMigrationProviderSetup.cs # IMigrationProviderSetup impl
├── UmbracoBuilderExtensions.cs # IUmbracoBuilder extensions
└── SqliteRetryingExecutionStrategy.cs # IExecutionStrategy for transient lock errors
```
### Relationship with Parent Project
### Relationship with Infrastructure
This project extends `Umbraco.Cms.Persistence.EFCore`:
This project extends `Umbraco.Infrastructure`:
- Implements `IMigrationProvider` interface defined in parent
- Implements `IMigrationProviderSetup` interface defined in parent
- Uses `UmbracoDbContext` from parent project
- Implements `IDatabaseConfigurator` interface defined in Infrastructure
- Implements `IDbContextServiceRegistrar` interface defined in Infrastructure
- Implements `IMigrationProvider` interface defined in Infrastructure
- Implements `IMigrationProviderSetup` interface defined in Infrastructure
- Uses `UmbracoDbContext` from Infrastructure
- Provider name: `Microsoft.Data.Sqlite` (from `Constants.ProviderNames.SQLLite`)
---
@@ -49,23 +60,42 @@ This project extends `Umbraco.Cms.Persistence.EFCore`:
## 2. Commands
**For Git workflow and build commands**, see [repository root](../../CLAUDE.md).
**For EF Core migration commands**, see [parent project](../Umbraco.Cms.Persistence.EFCore/CLAUDE.md) (substitute `-p src/Umbraco.Cms.Persistence.EFCore.Sqlite`).
```bash
# Build this project
dotnet build src/Umbraco.Cms.Persistence.EFCore.Sqlite
# Run related tests
dotnet test --filter "FullyQualifiedName~EFCore"
```
---
## 3. Key Components
### EFCoreSqliteComposer (line 10-14)
### EFCoreSqliteComposer
Registers `IMigrationProvider` and `IMigrationProviderSetup` for SQLite.
Registers SQLite implementations of `IMigrationProvider`, `IMigrationProviderSetup`, and provider registration services.
### SqliteDatabaseConfigurator
Implements `IDatabaseConfigurator` to configure `DbContextOptionsBuilder` with `UseSqlite`. Called by `DbContextRegistration` when registering DbContext types.
### SqliteDbContextServiceRegistrar
Implements `IDbContextServiceRegistrar` to register SQLite-specific services (e.g., distributed locking) for each registered DbContext type.
### SqliteEFCoreDistributedLockingMechanism
SQLite-specific distributed locking implementation. Moved from Infrastructure to this provider package as it is provider-specific.
### SqliteMigrationProvider
- `MigrateAsync(EFCoreMigration)` - Runs specific named migration
- `MigrateAllAsync()` - Runs all pending migrations
- **Critical**: Cannot run `MigrateAllAsync` when transaction is active (line 26-29)
- **Critical**: Cannot run `MigrateAllAsync` when transaction is active
### SqliteMigrationProviderSetup (line 11-14)
### SqliteMigrationProviderSetup
Configures `DbContextOptionsBuilder` with `UseSqlite`, the migrations assembly, and the
`SqliteRetryingExecutionStrategy` (see below). Invoked from
@@ -81,6 +111,10 @@ from the parent project. Defaults inherit `ExecutionStrategy.DefaultMaxRetryCoun
XML doc for the rationale and the unattended-upgrade escape hatch for very long migrations.
Added to resolve issue #22939 (OpenIddict token reads failing during long migrations).
### UmbracoBuilderExtensions
Extension methods on `IUmbracoBuilder` for adding SQLite EF Core support to the application.
---
## 4. Migrations
@@ -93,6 +127,7 @@ Added to resolve issue #22939 (OpenIddict token reads failing during long migrat
| `AddOpenIddict` | 2023-08-07 | Creates OpenIddict tables (Applications, Tokens, Authorizations, Scopes) |
| `UpdateOpenIddictToV5` | 2024-04-03 | Schema updates for OpenIddict v5 |
| `UpdateOpenIddictToV7` | 2025-10-06 | No-op for SQLite (no schema changes needed) |
| `AddWebhookDto` | 2026-02-09 | Webhook tables |
### OpenIddict Tables Created
@@ -111,9 +146,25 @@ All tables prefixed with `umbraco`:
### Adding New Migrations
1. Configure SQLite connection string in `src/Umbraco.Web.UI/appsettings.json`
2. Run migration command from repository root (see parent project docs)
3. **Critical**: Also add equivalent migration to `Umbraco.Cms.Persistence.EFCore.SqlServer`
4. Update `SqliteMigrationProvider.GetMigrationType()` switch (line 34-42) if adding named migrations
2. Run from repository root:
```bash
dotnet ef migrations add %Name% -s src/Umbraco.Web.UI -p src/Umbraco.Cms.Persistence.EFCore.Sqlite -c UmbracoDbContext
```
3. Empty the `Up()` and `Down()` methods (these are no-ops — NPoco creates the tables)
4. **Critical**: Also add equivalent migration to `Umbraco.Cms.Persistence.EFCore.SqlServer`
5. Update `SqliteMigrationProvider.GetMigrationType()` switch if adding named migrations
### Model Customizers
SQLite does **NOT** need per-DTO customizers for index features like `.IncludeProperties()` — those are SQL Server-specific.
However, SQLite **does** require a global collation customizer. NPoco's `SqliteSyntaxProvider` creates ALL string columns as `TEXT COLLATE NOCASE` (case-insensitive), matching SQL Server's typical `CI_AS` database-level collation. EF Core's SQLite provider creates plain `TEXT` columns, which default to `BINARY` (case-sensitive). Without a customizer, string comparisons (lookups by alias, email, login, ISO code, dictionary keys, etc.) would silently break when EF Core takes over table creation.
**This is already handled automatically by `SqliteCollationModelCustomizer`**, registered in `UmbracoBuilderExtensions`. It iterates all entity types in the model and applies `.UseCollation("NOCASE")` to every string property. No per-DTO action is required when adding new DTOs.
**Why not per-property in shared configurations?** Adding `.UseCollation("NOCASE")` to every string property in every `IEntityTypeConfiguration` would be verbose (80+ DTOs), error-prone, and would affect SQL Server unnecessarily. A single SQLite-specific customizer is cleaner.
**Full migration guide**: See `/src/Umbraco.Infrastructure/CLAUDE.md` → "Section 12: EF Core DTO Migration Guide".
---
@@ -121,7 +172,7 @@ All tables prefixed with `umbraco`:
### Named Migration Mapping
`SqliteMigrationProvider.GetMigrationType()` (line 34-42) maps `EFCoreMigration` enum to migration types. When adding named migrations, update both the parent project's enum and this switch.
`SqliteMigrationProvider.GetMigrationType()` maps `EFCoreMigration` enum to migration types. When adding named migrations, update both the enum in Infrastructure and this switch.
### Auto-Generated Files
@@ -135,15 +186,20 @@ All tables prefixed with `umbraco`:
| File | Purpose |
|------|---------|
| `SqliteCollationModelCustomizer.cs` | Applies `COLLATE NOCASE` to all string properties globally |
| `SqliteDatabaseConfigurator.cs` | DbContext configuration (IDatabaseConfigurator) |
| `SqliteDbContextServiceRegistrar.cs` | Provider service registration (IDbContextServiceRegistrar) |
| `SqliteEFCoreDistributedLockingMechanism.cs` | Distributed locking |
| `SqliteMigrationProvider.cs` | Migration execution |
| `SqliteMigrationProviderSetup.cs` | DbContext configuration (UseSqlite + retry strategy) |
| `SqliteMigrationProviderSetup.cs` | Migration DbContext configuration |
| `SqliteRetryingExecutionStrategy.cs` | Retry on transient SQLite BUSY/LOCKED errors |
| `EFCoreSqliteComposer.cs` | DI registration |
| `UmbracoBuilderExtensions.cs` | Builder extensions |
| `Migrations/*.cs` | Migration files |
### Provider Name
`Constants.ProviderNames.SQLLite` = `"Microsoft.Data.Sqlite"`
### Related Projects
- **Parent**: `Umbraco.Cms.Persistence.EFCore` - Interfaces and base DbContext
- **Parent**: `Umbraco.Infrastructure` - EF Core abstractions, DbContext, provider registration contracts
- **Sibling**: `Umbraco.Cms.Persistence.EFCore.SqlServer` - SQL Server equivalent
@@ -1,19 +1,14 @@
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Persistence.EFCore.Migrations;
namespace Umbraco.Cms.Persistence.EFCore.Sqlite;
/// <summary>
/// Composer for registering SQLite EF Core migration services.
/// Automatically adds SQLite EF Core support to Umbraco when this project is referenced.
/// </summary>
public class EFCoreSqliteComposer : IComposer
{
/// <inheritdoc />
public void Compose(IUmbracoBuilder builder)
{
builder.Services.AddSingleton<IMigrationProvider, SqliteMigrationProvider>();
builder.Services.AddSingleton<IMigrationProviderSetup, SqliteMigrationProviderSetup>();
}
=> builder.AddUmbracoEFCoreSqliteSupport();
}
@@ -4,6 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
@@ -4,6 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
@@ -4,6 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
using Umbraco.Cms.Persistence.EFCore;
#nullable disable
@@ -4,6 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
using Umbraco.Cms.Persistence.EFCore;
#nullable disable
@@ -0,0 +1,397 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260209100831_AddWebhookDto")]
partial class AddWebhookDto
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("ClientSecret")
.HasColumnType("TEXT");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("DisplayName")
.HasColumnType("TEXT");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT");
b.Property<string>("JsonWebKeySet")
.HasColumnType("TEXT");
b.Property<string>("Permissions")
.HasColumnType("TEXT");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<string>("RedirectUris")
.HasColumnType("TEXT");
b.Property<string>("Requirements")
.HasColumnType("TEXT");
b.Property<string>("Settings")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique();
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<string>("Scopes")
.HasColumnType("TEXT");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("Descriptions")
.HasColumnType("TEXT");
b.Property<string>("DisplayName")
.HasColumnType("TEXT");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<string>("Resources")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT");
b.Property<string>("AuthorizationId")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("TEXT");
b.Property<string>("Payload")
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("TEXT");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique();
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("TEXT")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("TEXT")
.HasColumnName("event");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("TEXT")
.HasColumnName("Key");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasColumnName("description");
b.Property<bool>("Enabled")
.HasColumnType("INTEGER")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("TEXT")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("TEXT")
.HasColumnName("name");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("url");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,22 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class AddWebhookDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// NO-OP to make EFCore happy
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,452 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260219113420_AddLastSyncedDto")]
partial class AddLastSyncedDto
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("ClientSecret")
.HasColumnType("TEXT");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("DisplayName")
.HasColumnType("TEXT");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT");
b.Property<string>("JsonWebKeySet")
.HasColumnType("TEXT");
b.Property<string>("Permissions")
.HasColumnType("TEXT");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<string>("RedirectUris")
.HasColumnType("TEXT");
b.Property<string>("Requirements")
.HasColumnType("TEXT");
b.Property<string>("Settings")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique();
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<string>("Scopes")
.HasColumnType("TEXT");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("Descriptions")
.HasColumnType("TEXT");
b.Property<string>("DisplayName")
.HasColumnType("TEXT");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<string>("Resources")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT");
b.Property<string>("AuthorizationId")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("TEXT");
b.Property<string>("Payload")
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("TEXT");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique();
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.CacheInstructionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<int>("InstructionCount")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(1)
.HasColumnName("instructionCount");
b.Property<string>("Instructions")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("jsonInstruction");
b.Property<string>("OriginIdentity")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasColumnName("originated");
b.Property<DateTime>("UtcStamp")
.HasColumnType("TEXT")
.HasColumnName("utcStamp");
b.HasKey("Id");
b.ToTable("umbracoCacheInstruction", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LastSyncedDto", b =>
{
b.Property<string>("MachineId")
.HasColumnType("TEXT")
.HasColumnName("machineId");
b.Property<DateTime>("LastSyncedDate")
.HasColumnType("TEXT")
.HasColumnName("lastSyncedDate");
b.Property<int?>("LastSyncedExternalId")
.HasColumnType("INTEGER");
b.Property<int?>("LastSyncedInternalId")
.HasColumnType("INTEGER")
.HasColumnName("lastSyncedInternalId");
b.HasKey("MachineId");
b.ToTable("umbracoLastSynced", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("TEXT")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("TEXT")
.HasColumnName("event");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("TEXT")
.HasColumnName("Key");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasColumnName("description");
b.Property<bool>("Enabled")
.HasColumnType("INTEGER")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("TEXT")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("TEXT")
.HasColumnName("name");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("url");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,22 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class AddLastSyncedDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// NO-OP
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,472 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260227113911_AddKeyValueDto")]
partial class AddKeyValueDto
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("ClientSecret")
.HasColumnType("TEXT");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("DisplayName")
.HasColumnType("TEXT");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT");
b.Property<string>("JsonWebKeySet")
.HasColumnType("TEXT");
b.Property<string>("Permissions")
.HasColumnType("TEXT");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<string>("RedirectUris")
.HasColumnType("TEXT");
b.Property<string>("Requirements")
.HasColumnType("TEXT");
b.Property<string>("Settings")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique();
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<string>("Scopes")
.HasColumnType("TEXT");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("Descriptions")
.HasColumnType("TEXT");
b.Property<string>("DisplayName")
.HasColumnType("TEXT");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<string>("Resources")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT");
b.Property<string>("AuthorizationId")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("TEXT");
b.Property<string>("Payload")
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("TEXT");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique();
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.CacheInstructionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<int>("InstructionCount")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(1)
.HasColumnName("instructionCount");
b.Property<string>("Instructions")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("jsonInstruction");
b.Property<string>("OriginIdentity")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasColumnName("originated");
b.Property<DateTime>("UtcStamp")
.HasColumnType("TEXT")
.HasColumnName("utcStamp");
b.HasKey("Id");
b.ToTable("umbracoCacheInstruction", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.KeyValueDto", b =>
{
b.Property<string>("Key")
.HasMaxLength(256)
.HasColumnType("TEXT")
.HasColumnName("key");
b.Property<DateTime>("UpdateDate")
.HasColumnType("TEXT")
.HasColumnName("updated");
b.Property<string>("Value")
.HasColumnType("TEXT")
.HasColumnName("value");
b.HasKey("Key");
b.ToTable("umbracoKeyValue", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LastSyncedDto", b =>
{
b.Property<string>("MachineId")
.HasColumnType("TEXT")
.HasColumnName("machineId");
b.Property<DateTime>("LastSyncedDate")
.HasColumnType("TEXT")
.HasColumnName("lastSyncedDate");
b.Property<int?>("LastSyncedExternalId")
.HasColumnType("INTEGER");
b.Property<int?>("LastSyncedInternalId")
.HasColumnType("INTEGER")
.HasColumnName("lastSyncedInternalId");
b.HasKey("MachineId");
b.ToTable("umbracoLastSynced", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("TEXT")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("TEXT")
.HasColumnName("event");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("TEXT")
.HasColumnName("Key");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasColumnName("description");
b.Property<bool>("Enabled")
.HasColumnType("INTEGER")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("TEXT")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("TEXT")
.HasColumnName("name");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("url");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class AddKeyValueDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// NO-OP
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,526 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260305124920_SqliteCollation")]
partial class SqliteCollation
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ClientSecret")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayName")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("JsonWebKeySet")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Permissions")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("RedirectUris")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Requirements")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Settings")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique();
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Scopes")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Description")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Descriptions")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayName")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Resources")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("AuthorizationId")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("TEXT");
b.Property<string>("Payload")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("TEXT");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique();
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.CacheInstructionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<int>("InstructionCount")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(1)
.HasColumnName("instructionCount");
b.Property<string>("Instructions")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("jsonInstruction")
.UseCollation("NOCASE");
b.Property<string>("OriginIdentity")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasColumnName("originated")
.UseCollation("NOCASE");
b.Property<DateTime>("UtcStamp")
.HasColumnType("TEXT")
.HasColumnName("utcStamp");
b.HasKey("Id");
b.ToTable("umbracoCacheInstruction", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.KeyValueDto", b =>
{
b.Property<string>("Key")
.HasMaxLength(256)
.HasColumnType("TEXT")
.HasColumnName("key")
.UseCollation("NOCASE");
b.Property<DateTime>("UpdateDate")
.HasColumnType("TEXT")
.HasColumnName("updated");
b.Property<string>("Value")
.HasColumnType("TEXT")
.HasColumnName("value")
.UseCollation("NOCASE");
b.HasKey("Key");
b.ToTable("umbracoKeyValue", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LastSyncedDto", b =>
{
b.Property<string>("MachineId")
.HasColumnType("TEXT")
.HasColumnName("machineId")
.UseCollation("NOCASE");
b.Property<DateTime>("LastSyncedDate")
.HasColumnType("TEXT")
.HasColumnName("lastSyncedDate");
b.Property<int?>("LastSyncedExternalId")
.HasColumnType("INTEGER");
b.Property<int?>("LastSyncedInternalId")
.HasColumnType("INTEGER")
.HasColumnName("lastSyncedInternalId");
b.HasKey("MachineId");
b.ToTable("umbracoLastSynced", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("TEXT")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("TEXT")
.HasColumnName("event")
.UseCollation("NOCASE");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("TEXT")
.HasColumnName("Key")
.UseCollation("NOCASE");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasColumnName("description")
.UseCollation("NOCASE");
b.Property<bool>("Enabled")
.HasColumnType("INTEGER")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("TEXT")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("TEXT")
.HasColumnName("name")
.UseCollation("NOCASE");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("url")
.UseCollation("NOCASE");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class SqliteCollation : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// NO-OP
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
// NO-OP
}
}
}
@@ -0,0 +1,588 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260323132733_AddLanguageDto")]
partial class AddLanguageDto
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ClientSecret")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayName")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("JsonWebKeySet")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Permissions")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("RedirectUris")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Requirements")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Settings")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique();
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Scopes")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Description")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Descriptions")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayName")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Resources")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("AuthorizationId")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("TEXT");
b.Property<string>("Payload")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("TEXT");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique();
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.CacheInstructionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<int>("InstructionCount")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(1)
.HasColumnName("instructionCount");
b.Property<string>("Instructions")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("jsonInstruction")
.UseCollation("NOCASE");
b.Property<string>("OriginIdentity")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasColumnName("originated")
.UseCollation("NOCASE");
b.Property<DateTime>("UtcStamp")
.HasColumnType("TEXT")
.HasColumnName("utcStamp");
b.HasKey("Id");
b.ToTable("umbracoCacheInstruction", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.KeyValueDto", b =>
{
b.Property<string>("Key")
.HasMaxLength(256)
.HasColumnType("TEXT")
.HasColumnName("key")
.UseCollation("NOCASE");
b.Property<DateTime>("UpdateDate")
.HasColumnType("TEXT")
.HasColumnName("updated");
b.Property<string>("Value")
.HasColumnType("TEXT")
.HasColumnName("value")
.UseCollation("NOCASE");
b.HasKey("Key");
b.ToTable("umbracoKeyValue", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("CultureName")
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasColumnName("languageCultureName")
.UseCollation("NOCASE");
b.Property<int?>("FallbackLanguageId")
.HasColumnType("INTEGER")
.HasColumnName("fallbackLanguageId");
b.Property<bool>("IsDefault")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false)
.HasColumnName("isDefaultVariantLang");
b.Property<bool>("IsMandatory")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false)
.HasColumnName("mandatory");
b.Property<string>("IsoCode")
.HasMaxLength(14)
.HasColumnType("TEXT")
.HasColumnName("languageISOCode")
.UseCollation("NOCASE");
b.Property<Guid>("LanguageKey")
.HasColumnType("TEXT")
.HasColumnName("languageKey");
b.HasKey("Id");
b.HasIndex("FallbackLanguageId");
b.HasIndex("IsoCode")
.IsUnique();
b.HasIndex("LanguageKey")
.IsUnique();
b.ToTable("umbracoLanguage", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LastSyncedDto", b =>
{
b.Property<string>("MachineId")
.HasColumnType("TEXT")
.HasColumnName("machineId")
.UseCollation("NOCASE");
b.Property<DateTime>("LastSyncedDate")
.HasColumnType("TEXT")
.HasColumnName("lastSyncedDate");
b.Property<int?>("LastSyncedExternalId")
.HasColumnType("INTEGER");
b.Property<int?>("LastSyncedInternalId")
.HasColumnType("INTEGER")
.HasColumnName("lastSyncedInternalId");
b.HasKey("MachineId");
b.ToTable("umbracoLastSynced", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("TEXT")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("TEXT")
.HasColumnName("event")
.UseCollation("NOCASE");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("TEXT")
.HasColumnName("Key")
.UseCollation("NOCASE");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasColumnName("description")
.UseCollation("NOCASE");
b.Property<bool>("Enabled")
.HasColumnType("INTEGER")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("TEXT")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("TEXT")
.HasColumnName("name")
.UseCollation("NOCASE");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("url")
.UseCollation("NOCASE");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", "FallbackLanguage")
.WithMany()
.HasForeignKey("FallbackLanguageId")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("FallbackLanguage");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class AddLanguageDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,714 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260326120231_AddDomainDto")]
partial class AddDomainDto
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.5");
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ClientSecret")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayName")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("JsonWebKeySet")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Permissions")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("RedirectUris")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Requirements")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Settings")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique();
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Scopes")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Description")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Descriptions")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayName")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Resources")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("AuthorizationId")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("TEXT");
b.Property<string>("Payload")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("TEXT");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique();
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.CacheInstructionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<int>("InstructionCount")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(1)
.HasColumnName("instructionCount");
b.Property<string>("Instructions")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("jsonInstruction")
.UseCollation("NOCASE");
b.Property<string>("OriginIdentity")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasColumnName("originated")
.UseCollation("NOCASE");
b.Property<DateTime>("UtcStamp")
.HasColumnType("TEXT")
.HasColumnName("utcStamp");
b.HasKey("Id");
b.ToTable("umbracoCacheInstruction", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.DomainDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<int?>("DefaultLanguage")
.HasColumnType("INTEGER")
.HasColumnName("domainDefaultLanguage");
b.Property<string>("DomainName")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("domainName")
.UseCollation("NOCASE");
b.Property<Guid>("Key")
.HasColumnType("TEXT")
.HasColumnName("key");
b.Property<int?>("RootStructureId")
.HasColumnType("INTEGER")
.HasColumnName("domainRootStructureID");
b.Property<int>("SortOrder")
.HasColumnType("INTEGER")
.HasColumnName("sortOrder");
b.HasKey("Id");
b.HasIndex("Key")
.IsUnique();
b.ToTable("umbracoDomain", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.KeyValueDto", b =>
{
b.Property<string>("Key")
.HasMaxLength(256)
.HasColumnType("TEXT")
.HasColumnName("key")
.UseCollation("NOCASE");
b.Property<DateTime>("UpdateDate")
.HasColumnType("TEXT")
.HasColumnName("updated");
b.Property<string>("Value")
.HasColumnType("TEXT")
.HasColumnName("value")
.UseCollation("NOCASE");
b.HasKey("Key");
b.ToTable("umbracoKeyValue", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("CultureName")
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasColumnName("languageCultureName")
.UseCollation("NOCASE");
b.Property<int?>("FallbackLanguageId")
.HasColumnType("INTEGER")
.HasColumnName("fallbackLanguageId");
b.Property<bool>("IsDefault")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false)
.HasColumnName("isDefaultVariantLang");
b.Property<bool>("IsMandatory")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false)
.HasColumnName("mandatory");
b.Property<string>("IsoCode")
.HasMaxLength(14)
.HasColumnType("TEXT")
.HasColumnName("languageISOCode")
.UseCollation("NOCASE");
b.Property<Guid>("LanguageKey")
.HasColumnType("TEXT")
.HasColumnName("languageKey");
b.HasKey("Id");
b.HasIndex("FallbackLanguageId");
b.HasIndex("IsoCode")
.IsUnique();
b.HasIndex("LanguageKey")
.IsUnique();
b.ToTable("umbracoLanguage", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LastSyncedDto", b =>
{
b.Property<string>("MachineId")
.HasColumnType("TEXT")
.HasColumnName("machineId")
.UseCollation("NOCASE");
b.Property<DateTime>("LastSyncedDate")
.HasColumnType("TEXT")
.HasColumnName("lastSyncedDate");
b.Property<int?>("LastSyncedExternalId")
.HasColumnType("INTEGER");
b.Property<int?>("LastSyncedInternalId")
.HasColumnType("INTEGER")
.HasColumnName("lastSyncedInternalId");
b.HasKey("MachineId");
b.ToTable("umbracoLastSynced", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", b =>
{
b.Property<int>("NodeId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<DateTime>("CreateDate")
.HasColumnType("TEXT")
.HasColumnName("createDate");
b.Property<short>("Level")
.HasColumnType("INTEGER")
.HasColumnName("level");
b.Property<Guid?>("NodeObjectType")
.HasColumnType("TEXT")
.HasColumnName("nodeObjectType");
b.Property<int>("ParentId")
.HasColumnType("INTEGER")
.HasColumnName("parentId");
b.Property<string>("Path")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("TEXT")
.HasColumnName("path")
.UseCollation("NOCASE");
b.Property<int>("SortOrder")
.HasColumnType("INTEGER")
.HasColumnName("sortOrder");
b.Property<string>("Text")
.HasColumnType("TEXT")
.HasColumnName("text")
.UseCollation("NOCASE");
b.Property<bool>("Trashed")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false)
.HasColumnName("trashed");
b.Property<Guid>("UniqueId")
.HasColumnType("TEXT")
.HasColumnName("uniqueId");
b.Property<int?>("UserId")
.HasColumnType("INTEGER")
.HasColumnName("nodeUser");
b.HasKey("NodeId");
b.HasIndex("Path")
.HasDatabaseName("IX_umbracoNode_Path");
b.HasIndex("Trashed")
.HasDatabaseName("IX_umbracoNode_Trashed");
b.HasIndex("UniqueId")
.IsUnique()
.HasDatabaseName("IX_umbracoNode_UniqueId");
b.HasIndex("NodeObjectType", "Trashed")
.HasDatabaseName("IX_umbracoNode_ObjectType");
b.HasIndex("ParentId", "NodeObjectType")
.HasDatabaseName("IX_umbracoNode_parentId_nodeObjectType");
b.HasIndex("NodeObjectType", "Trashed", "SortOrder", "NodeId")
.HasDatabaseName("IX_umbracoNode_ObjectType_trashed_sorted");
b.HasIndex("Level", "ParentId", "SortOrder", "NodeObjectType", "Trashed")
.HasDatabaseName("IX_umbracoNode_Level");
b.ToTable("umbracoNode", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("TEXT")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("TEXT")
.HasColumnName("event")
.UseCollation("NOCASE");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("TEXT")
.HasColumnName("Key")
.UseCollation("NOCASE");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasColumnName("description")
.UseCollation("NOCASE");
b.Property<bool>("Enabled")
.HasColumnType("INTEGER")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("TEXT")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("TEXT")
.HasColumnName("name")
.UseCollation("NOCASE");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("url")
.UseCollation("NOCASE");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", "FallbackLanguage")
.WithMany()
.HasForeignKey("FallbackLanguageId")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("FallbackLanguage");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", null)
.WithMany()
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class AddDomainDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,967 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Umbraco.Cms.Infrastructure.Persistence.EFCore;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
[DbContext(typeof(UmbracoDbContext))]
[Migration("20260430104904_AddAuditDtos")]
partial class AddAuditDtos
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.5");
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ClientSecret")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConsentType")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayName")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("JsonWebKeySet")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Permissions")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("RedirectUris")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Requirements")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Settings")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique();
b.ToTable("umbracoOpenIddictApplications", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Scopes")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictAuthorizations", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Description")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Descriptions")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayName")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("DisplayNames")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Name")
.HasMaxLength(200)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Resources")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("umbracoOpenIddictScopes", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("AuthorizationId")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<DateTime?>("CreationDate")
.HasColumnType("TEXT");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("TEXT");
b.Property<string>("Payload")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Properties")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<DateTime?>("RedemptionDate")
.HasColumnType("TEXT");
b.Property<string>("ReferenceId")
.HasMaxLength(100)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Status")
.HasMaxLength(50)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Subject")
.HasMaxLength(400)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Type")
.HasMaxLength(150)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("Id");
b.HasIndex("AuthorizationId");
b.HasIndex("ReferenceId")
.IsUnique();
b.HasIndex("ApplicationId", "Status", "Subject", "Type");
b.ToTable("umbracoOpenIddictTokens", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.AuditEntryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("AffectedDetails")
.HasMaxLength(1024)
.HasColumnType("TEXT")
.HasColumnName("affectedDetails")
.UseCollation("NOCASE");
b.Property<int>("AffectedUserId")
.HasColumnType("INTEGER")
.HasColumnName("affectedUserId");
b.Property<Guid?>("AffectedUserKey")
.HasColumnType("TEXT")
.HasColumnName("affectedUserKey");
b.Property<DateTime>("EventDate")
.HasColumnType("TEXT")
.HasColumnName("eventDateUtc");
b.Property<string>("EventDetails")
.HasMaxLength(1024)
.HasColumnType("TEXT")
.HasColumnName("eventDetails")
.UseCollation("NOCASE");
b.Property<string>("EventType")
.HasMaxLength(256)
.HasColumnType("TEXT")
.HasColumnName("eventType")
.UseCollation("NOCASE");
b.Property<string>("PerformingDetails")
.HasMaxLength(1024)
.HasColumnType("TEXT")
.HasColumnName("performingDetails")
.UseCollation("NOCASE");
b.Property<string>("PerformingIp")
.HasMaxLength(64)
.HasColumnType("TEXT")
.HasColumnName("performingIp")
.UseCollation("NOCASE");
b.Property<int>("PerformingUserId")
.HasColumnType("INTEGER")
.HasColumnName("performingUserId");
b.Property<Guid?>("PerformingUserKey")
.HasColumnType("TEXT")
.HasColumnName("performingUserKey");
b.HasKey("Id");
b.ToTable("umbracoAudit", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.CacheInstructionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<int>("InstructionCount")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(1)
.HasColumnName("instructionCount");
b.Property<string>("Instructions")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("jsonInstruction")
.UseCollation("NOCASE");
b.Property<string>("OriginIdentity")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasColumnName("originated")
.UseCollation("NOCASE");
b.Property<DateTime>("UtcStamp")
.HasColumnType("TEXT")
.HasColumnName("utcStamp");
b.HasKey("Id");
b.ToTable("umbracoCacheInstruction", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.DomainDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<int?>("DefaultLanguage")
.HasColumnType("INTEGER")
.HasColumnName("domainDefaultLanguage");
b.Property<string>("DomainName")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("domainName")
.UseCollation("NOCASE");
b.Property<Guid>("Key")
.HasColumnType("TEXT")
.HasColumnName("key");
b.Property<int?>("RootStructureId")
.HasColumnType("INTEGER")
.HasColumnName("domainRootStructureID");
b.Property<int>("SortOrder")
.HasColumnType("INTEGER")
.HasColumnName("sortOrder");
b.HasKey("Id");
b.HasIndex("Key")
.IsUnique();
b.ToTable("umbracoDomain", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.KeyValueDto", b =>
{
b.Property<string>("Key")
.HasMaxLength(256)
.HasColumnType("TEXT")
.HasColumnName("key")
.UseCollation("NOCASE");
b.Property<DateTime>("UpdateDate")
.HasColumnType("TEXT")
.HasColumnName("updated");
b.Property<string>("Value")
.HasColumnType("TEXT")
.HasColumnName("value")
.UseCollation("NOCASE");
b.HasKey("Key");
b.ToTable("umbracoKeyValue", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("CultureName")
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasColumnName("languageCultureName")
.UseCollation("NOCASE");
b.Property<int?>("FallbackLanguageId")
.HasColumnType("INTEGER")
.HasColumnName("fallbackLanguageId");
b.Property<bool>("IsDefault")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false)
.HasColumnName("isDefaultVariantLang");
b.Property<bool>("IsMandatory")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false)
.HasColumnName("mandatory");
b.Property<string>("IsoCode")
.HasMaxLength(14)
.HasColumnType("TEXT")
.HasColumnName("languageISOCode")
.UseCollation("NOCASE");
b.Property<Guid>("LanguageKey")
.HasColumnType("TEXT")
.HasColumnName("languageKey");
b.HasKey("Id");
b.HasIndex("FallbackLanguageId");
b.HasIndex("IsoCode")
.IsUnique();
b.HasIndex("LanguageKey")
.IsUnique();
b.ToTable("umbracoLanguage", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LastSyncedDto", b =>
{
b.Property<string>("MachineId")
.HasColumnType("TEXT")
.HasColumnName("machineId")
.UseCollation("NOCASE");
b.Property<DateTime>("LastSyncedDate")
.HasColumnType("TEXT")
.HasColumnName("lastSyncedDate");
b.Property<int?>("LastSyncedExternalId")
.HasColumnType("INTEGER");
b.Property<int?>("LastSyncedInternalId")
.HasColumnType("INTEGER")
.HasColumnName("lastSyncedInternalId");
b.HasKey("MachineId");
b.ToTable("umbracoLastSynced", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LogDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("Comment")
.HasMaxLength(4000)
.HasColumnType("TEXT")
.HasColumnName("logComment")
.UseCollation("NOCASE");
b.Property<DateTime>("Datestamp")
.HasColumnType("TEXT")
.HasColumnName("Datestamp");
b.Property<string>("EntityType")
.HasMaxLength(50)
.HasColumnType("TEXT")
.HasColumnName("entityType")
.UseCollation("NOCASE");
b.Property<string>("Header")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT")
.HasColumnName("logHeader")
.UseCollation("NOCASE");
b.Property<int>("NodeId")
.HasColumnType("INTEGER")
.HasColumnName("NodeId");
b.Property<string>("Parameters")
.HasMaxLength(4000)
.HasColumnType("TEXT")
.HasColumnName("parameters")
.UseCollation("NOCASE");
b.Property<int?>("UserId")
.HasColumnType("INTEGER")
.HasColumnName("userId");
b.HasKey("Id");
b.HasIndex("NodeId")
.HasDatabaseName("IX_umbracoLog");
b.HasIndex("UserId");
b.HasIndex("Datestamp", "Header")
.HasDatabaseName("IX_umbracoLog_datestamp_logheader");
b.HasIndex("Datestamp", "UserId", "NodeId")
.HasDatabaseName("IX_umbracoLog_datestamp");
b.ToTable("umbracoLog", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", b =>
{
b.Property<int>("NodeId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<DateTime>("CreateDate")
.HasColumnType("TEXT")
.HasColumnName("createDate");
b.Property<short>("Level")
.HasColumnType("INTEGER")
.HasColumnName("level");
b.Property<Guid?>("NodeObjectType")
.HasColumnType("TEXT")
.HasColumnName("nodeObjectType");
b.Property<int>("ParentId")
.HasColumnType("INTEGER")
.HasColumnName("parentId");
b.Property<string>("Path")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("TEXT")
.HasColumnName("path")
.UseCollation("NOCASE");
b.Property<int>("SortOrder")
.HasColumnType("INTEGER")
.HasColumnName("sortOrder");
b.Property<string>("Text")
.HasColumnType("TEXT")
.HasColumnName("text")
.UseCollation("NOCASE");
b.Property<bool>("Trashed")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false)
.HasColumnName("trashed");
b.Property<Guid>("UniqueId")
.HasColumnType("TEXT")
.HasColumnName("uniqueId");
b.Property<int?>("UserId")
.HasColumnType("INTEGER")
.HasColumnName("nodeUser");
b.HasKey("NodeId");
b.HasIndex("Path")
.HasDatabaseName("IX_umbracoNode_Path");
b.HasIndex("Trashed")
.HasDatabaseName("IX_umbracoNode_Trashed");
b.HasIndex("UniqueId")
.IsUnique()
.HasDatabaseName("IX_umbracoNode_UniqueId");
b.HasIndex("NodeObjectType", "Trashed")
.HasDatabaseName("IX_umbracoNode_ObjectType");
b.HasIndex("ParentId", "NodeObjectType")
.HasDatabaseName("IX_umbracoNode_parentId_nodeObjectType");
b.HasIndex("NodeObjectType", "Trashed", "SortOrder", "NodeId")
.HasDatabaseName("IX_umbracoNode_ObjectType_trashed_sorted");
b.HasIndex("Level", "ParentId", "SortOrder", "NodeObjectType", "Trashed")
.HasDatabaseName("IX_umbracoNode_Level");
b.ToTable("umbracoNode", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("Avatar")
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasColumnName("avatar")
.UseCollation("NOCASE");
b.Property<DateTime>("CreateDate")
.HasColumnType("TEXT")
.HasColumnName("createDate");
b.Property<bool>("Disabled")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false)
.HasColumnName("userDisabled");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("userEmail")
.UseCollation("NOCASE");
b.Property<DateTime?>("EmailConfirmedDate")
.HasColumnType("TEXT")
.HasColumnName("emailConfirmedDate");
b.Property<int?>("FailedLoginAttempts")
.HasColumnType("INTEGER")
.HasColumnName("failedLoginAttempts");
b.Property<DateTime?>("InvitedDate")
.HasColumnType("TEXT")
.HasColumnName("invitedDate");
b.Property<Guid>("Key")
.HasColumnType("TEXT")
.HasColumnName("key");
b.Property<short>("Kind")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue((short)0)
.HasColumnName("kind");
b.Property<DateTime?>("LastLockoutDate")
.HasColumnType("TEXT")
.HasColumnName("lastLockoutDate");
b.Property<DateTime?>("LastLoginDate")
.HasColumnType("TEXT")
.HasColumnName("lastLoginDate");
b.Property<DateTime?>("LastPasswordChangeDate")
.HasColumnType("TEXT")
.HasColumnName("lastPasswordChangeDate");
b.Property<string>("Login")
.HasMaxLength(125)
.HasColumnType("TEXT")
.HasColumnName("userLogin")
.UseCollation("NOCASE");
b.Property<bool>("NoConsole")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false)
.HasColumnName("userNoConsole");
b.Property<string>("Password")
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasColumnName("userPassword")
.UseCollation("NOCASE");
b.Property<string>("PasswordConfig")
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasColumnName("passwordConfig")
.UseCollation("NOCASE");
b.Property<string>("SecurityStampToken")
.HasMaxLength(255)
.HasColumnType("TEXT")
.HasColumnName("securityStampToken")
.UseCollation("NOCASE");
b.Property<DateTime>("UpdateDate")
.HasColumnType("TEXT")
.HasColumnName("updateDate");
b.Property<string>("UserLanguage")
.HasMaxLength(10)
.HasColumnType("TEXT")
.HasColumnName("userLanguage")
.UseCollation("NOCASE");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("userName")
.UseCollation("NOCASE");
b.HasKey("Id")
.HasName("PK_user");
b.HasIndex("Key")
.IsUnique()
.HasDatabaseName("IX_umbracoUser_userKey");
b.HasIndex("Login");
b.ToTable("umbracoUser", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<Guid>("ContentTypeKey")
.HasColumnType("TEXT")
.HasColumnName("entityKey");
b.HasKey("WebhookId", "ContentTypeKey")
.HasName("PK_webhookEntityKey2Webhook");
b.ToTable("umbracoWebhook2ContentTypeKeys", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Event")
.HasMaxLength(255)
.HasColumnType("TEXT")
.HasColumnName("event")
.UseCollation("NOCASE");
b.HasKey("WebhookId", "Event")
.HasName("PK_webhookEvent2WebhookDto");
b.ToTable("umbracoWebhook2Events", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.Property<int>("WebhookId")
.HasColumnType("INTEGER")
.HasColumnName("webhookId");
b.Property<string>("Key")
.HasColumnType("TEXT")
.HasColumnName("Key")
.UseCollation("NOCASE");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.HasKey("WebhookId", "Key")
.HasName("PK_headers2WebhookDto");
b.ToTable("umbracoWebhook2Headers", (string)null);
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasColumnName("description")
.UseCollation("NOCASE");
b.Property<bool>("Enabled")
.HasColumnType("INTEGER")
.HasColumnName("enabled");
b.Property<Guid>("Key")
.HasColumnType("TEXT")
.HasColumnName("key");
b.Property<string>("Name")
.HasColumnType("TEXT")
.HasColumnName("name")
.UseCollation("NOCASE");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("url")
.UseCollation("NOCASE");
b.HasKey("Id");
b.ToTable("umbracoWebhook", (string)null);
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Authorizations")
.HasForeignKey("ApplicationId");
b.Navigation("Application");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
{
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
.WithMany("Tokens")
.HasForeignKey("ApplicationId");
b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
.WithMany("Tokens")
.HasForeignKey("AuthorizationId");
b.Navigation("Application");
b.Navigation("Authorization");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LanguageDto", "FallbackLanguage")
.WithMany()
.HasForeignKey("FallbackLanguageId")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("FallbackLanguage");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.LogDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.UserDto", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("User");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.NodeDto", null)
.WithMany()
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2ContentTypeKeysDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2ContentTypeKeys")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2EventsDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Events")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.Webhook2HeadersDto", b =>
{
b.HasOne("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", "Webhook")
.WithMany("Webhook2Headers")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
{
b.Navigation("Authorizations");
b.Navigation("Tokens");
});
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
{
b.Navigation("Tokens");
});
modelBuilder.Entity("Umbraco.Cms.Infrastructure.Persistence.Dtos.EFCore.WebhookDto", b =>
{
b.Navigation("Webhook2ContentTypeKeys");
b.Navigation("Webhook2Events");
b.Navigation("Webhook2Headers");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class AddAuditDtos : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class AddRelationDtos : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class AddLongRunningOperationDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class AddContentVersionCleanupPolicyDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,23 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class AddPublicAccessDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// NO-OP to satisfy EF Core
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
// NO-OP to satisfy EF Core
}
}
}
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class AddDistributedJobDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class AddConsentDto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations
{
/// <inheritdoc />
public partial class AddContentTypeDtos : Migration
{
// The tables already exist (they are created by the NPoco schema installer); this migration only
// updates the EF Core model snapshot.
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

Some files were not shown because too many files have changed in this diff Show More