Add and populate core.Documents.ParentType column#7231
Merged
labkey-adam merged 13 commits intodevelopfrom Dec 4, 2025
Merged
Conversation
…e excluded principals, before site groups are created
labkey-jeckels
approved these changes
Dec 2, 2025
| import org.labkey.api.data.SQLFragment; | ||
|
|
||
| /** | ||
| * Tags {@link Attachment} objects based on what they're attached to. Does not indicate that they are a file of a |
Contributor
There was a problem hiding this comment.
Line ending change to this while file?
Contributor
Author
There was a problem hiding this comment.
I honestly can't tell. IntelliJ doesn't think line endings changed. Opening before & after files in binary mode text editor shows no line ending changes. Maybe GitHub always shows renames this way?
Contributor
There was a problem hiding this comment.
It might look better if you add the new filename to .gitattributes
core/resources/schemas/dbscripts/sqlserver/core-25.008-25.009.sql
Outdated
Show resolved
Hide resolved
Co-authored-by: Josh Eckels <jeckels@labkey.com>
Conflicts: api/src/org/labkey/api/migration/DefaultMigrationSchemaHandler.java
Member
|
New upgrade code doesn't work on SQL Server: |
labkey-tchad
approved these changes
Dec 4, 2025
This was referenced Dec 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
Maintaining
ParentTypeoncore.Documentsprovides a fast way to associate attachments with their parents, which is useful for reporting, debugging, and eventually migrating to the global attachment managerhttps://docs.google.com/document/d/19UOpB6nMBZ-DesYWUC4MTyN0heKZt5KDmHI-p3TBrc4/edit?tab=t.0#heading=h.4rg4h5vuek0
Changes
AttachmentType->AttachmentParentTypefor clarity.AttachmentParentTypeimplementations to return short, human-readable names fromgetUniqueName(). No reason for long, verbose names in the DB and admin reports.ParentTypecolumn tocore.Documentsand populate via upgrade code that leverages existing AttachmentParentType.addWhereSql() methodDocumentsGroupedByParentTypequery to replace old admin report.${containerFilterName}substitution parameter option for URL templatesAllFoldersset as the container filter. ("Attachments - Old" is left pointed at the old page temporarily, to allow comparisons during testing.)@DeferredUpgradefor core scripts. Two issues prevented the use of this annotation for core upgrade code:core.UpgradeStepstable (where we queue the pending method names) was not recognized as in-the-database on bootstrap. Hoisting the cache clearing up a level causes it to be invoked in both cases.nullgroups into the excluded principals lists, which caused NPEs later. We can just pass in null to the insert. And I added a null check in addExcludedPrincipal() so we fail fast if this ever shows up again.Note: Many admin reports are available to Troubleshooters. This one is not (it's available to Site/App admin) only because it's implemented as a standard query that's shown via query-executeQuery.view, that action requires read permission in the current folder, and the Troubleshooter role doesn't grant read permissions anywhere.
Tasks 📍
fb_parent_typefeature branch in all five repos.