Skip to content

Some DTO Attributes Fixes#21670

Open
idseefeld wants to merge 75 commits intoumbraco:mainfrom
idseefeld:v173/20453-DTO-attributes-fixed
Open

Some DTO Attributes Fixes#21670
idseefeld wants to merge 75 commits intoumbraco:mainfrom
idseefeld:v173/20453-DTO-attributes-fixed

Conversation

@idseefeld
Copy link
Contributor

@idseefeld idseefeld commented Feb 6, 2026

This is another PR for issue #21675.
For DTOs without autoIncrement columns and multi-column primary keys attributes need updates to be fully compatible with NPoco. Especially an PostgreSQL provider has otherwise issues.

The created table sql stays unchanged!

All test must succeed and must not be any changes for existing database providers.

refactor new extensions into another file
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Hi there @idseefeld, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@idseefeld idseefeld marked this pull request as ready for review February 6, 2026 20:46
Copilot AI review requested due to automatic review settings February 6, 2026 20:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to improve NPoco compatibility for several persistence DTOs (especially composite-key / non-autoincrement scenarios) and to avoid case-sensitive SQL issues (e.g., PostgreSQL) by relying on DTO column name constants in delete clauses.

Changes:

  • Updated repository delete clauses to use DTO column-name constants instead of hard-coded strings.
  • Adjusted multiple DTOs’ primary key / table metadata (adding [PrimaryKey], introducing constants, updating PK column references for deletes).
  • Refactored some DTO constants to differentiate between key columns vs. other identifiers.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberRepository.cs Uses DTO column constant for nodeId delete clause to improve provider compatibility.
src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs Updates delete clauses to target the correct key columns after DTO constant refactors.
src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs Updates delete clauses to use updated DTO key column constants.
src/Umbraco.Infrastructure/Persistence/Dtos/Webhook2HeadersDto.cs Adds class-level PK metadata and refactors PK naming/constants.
src/Umbraco.Infrastructure/Persistence/Dtos/Webhook2EventsDto.cs Adds class-level PK metadata and refactors PK naming/constants.
src/Umbraco.Infrastructure/Persistence/Dtos/Webhook2ContentTypeKeysDto.cs Adds class-level PK metadata and refactors PK naming/constants.
src/Umbraco.Infrastructure/Persistence/Dtos/UserGroup2NodePermissionDto.cs Adds class-level PK metadata and refactors PK naming/constants for composite PK.
src/Umbraco.Infrastructure/Persistence/Dtos/UserGroup2NodeDto.cs Adds class-level PK metadata and refactors PK naming/constants for composite PK.
src/Umbraco.Infrastructure/Persistence/Dtos/UserGroup2LanguageDto.cs Adds class-level PK metadata and refactors PK naming/constants for composite PK.
src/Umbraco.Infrastructure/Persistence/Dtos/UserGroup2AppDto.cs Refactors constants so PK constraint name and key columns are clearer (but see review comments).
src/Umbraco.Infrastructure/Persistence/Dtos/User2UserGroupDto.cs Adds class-level PK metadata and refactors PK naming/constants for composite PK.
src/Umbraco.Infrastructure/Persistence/Dtos/User2NodeNotifyDto.cs Refactors constants for composite PK and updates repositories to use the correct column constants.
src/Umbraco.Infrastructure/Persistence/Dtos/User2ClientIdDto.cs Refactors constants for composite PK and used by UserRepository insert/delete flows.
src/Umbraco.Infrastructure/Persistence/Dtos/TagRelationshipDto.cs Refactors constants and index definition to reference the correct nodeId column constant.
src/Umbraco.Infrastructure/Persistence/Dtos/Member2MemberGroupDto.cs Refactors constants for composite PK.
src/Umbraco.Infrastructure/Persistence/Dtos/ContentVersionCleanupPolicyDto.cs Renames PK constant usage (column name) and aligns PK constraint naming.
src/Umbraco.Infrastructure/Persistence/Dtos/ContentTypeTemplateDto.cs Refactors constants for composite PK and column naming.
src/Umbraco.Infrastructure/Persistence/Dtos/ContentTypeAllowedContentTypeDto.cs Refactors PK-related constants and FK column references.
src/Umbraco.Infrastructure/Persistence/Dtos/ContentType2ContentTypeDto.cs Refactors constants for composite PK and column naming.
src/Umbraco.Infrastructure/Persistence/Dtos/ContentNuDto.cs Refactors composite PK metadata and FK/index column references.

@idseefeld idseefeld marked this pull request as draft February 7, 2026 09:40
@idseefeld idseefeld marked this pull request as ready for review February 7, 2026 10:03
@idseefeld idseefeld marked this pull request as draft February 7, 2026 12:47
@idseefeld idseefeld marked this pull request as ready for review February 8, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant