fix(etl): persist DDEX rights metadata on track create - #517
Merged
Conversation
mergeTrackFromMetadata (the update path) has read artists,
resource_contributors, indirect_resource_contributors, rights_controller,
copyright_line, producer_copyright_line, parental_warning_type and
is_original_available for a while. The create INSERT never listed them, so a
track that arrives complete in a single Create silently loses all eight.
That is exactly the shape of every genesis-migration track: the writer selects
and emits these fields (cmd/genesis-writer/entities_track.go), the transaction
carries them, and the row lands with NULLs. Verified end to end on track
1810289900 -- data.rights_controller = {"name":"Michael Kumar",...} in the
migration tx, NULL in the tracks table.
Measured against the 2026-08-07 snapshot, the migration dropped:
artists 1,447
rights_controller 1,404
producer_copyright_line 1,459
parental_warning_type 1,459
is_original_available 28,827
indirect_resource_contributors 782
copyright_line 782
resource_contributors 686
The new test fails without this change on all four assertions.
This was referenced Aug 13, 2026
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.
What
mergeTrackFromMetadata(the update path) has read these eight fields for awhile. The create INSERT never listed them:
artists,resource_contributors,indirect_resource_contributors,rights_controller,copyright_line,producer_copyright_line,parental_warning_type,is_original_availableA track that arrives complete in a single
Createsilently loses all eight.Why the migration hits it every time
Every genesis-migration track is exactly that shape — one
Create, neverupdated. The writer selects and emits these fields
(
cmd/genesis-writer/entities_track.go), the transaction carries them, and therow lands with NULLs.
Verified end to end on track
1810289900:Measured loss (2026-08-07 snapshot)
is_original_availableproducer_copyright_lineparental_warning_typeartistsrights_controllerindirect_resource_contributorscopyright_lineresource_contributorsTest
TestTrackCreate_PersistsDdexRightsMetadatauses metadata shaped asgenesis-writer emits it. Reverting the fix fails it on all four assertions:
🤖 Generated with Claude Code