feat(schema): add rotation.lml_identity_id + library_identity enum value (BS#1380 PR 1/5)#1417
Merged
Merged
Conversation
…lue (BS#1380 PR 1/5) Adds the schema surface for the BS#1380 cross-cache-identity work; the runtime + ETL + backfill writers land in chained PRs (2-5). Migration 0094 (DDL-only, no index, no row UPDATE): - ALTER TABLE rotation ADD COLUMN lml_identity_id integer NULL (stable LML release-identity handle; points at entity.release_identity.id per LML#526. FK semantics live on LML's side; PG-level FK is not enforceable across the network. Seqscan-fine at the ~hundreds-of-active- rows scale, matching jobs/rotation-release-id-backfill/query.ts.) - ALTER TYPE discogs_release_id_source_enum ADD VALUE 'library_identity' AFTER 'discogs_direct_backfill' (new dj-site-side writer that doesn't fit any of the three existing tubafrenzy/operator-side values. Without this, the NOT NULL DEFAULT 'tubafrenzy_paste' would mislabel every dj-site row.) Schema doc comment at schema.ts:494-528 updated to document the fourth enum value alongside the existing three. No runtime code in this PR. The next PRs in the chain land the writers + tests: - PR 2: shared/lml-client `resolveIdentity` wrapper - PR 3: jobs/rotation-etl drift-prevention CASE - PR 4: apps/backend addToRotation + pickAddRotationFields allowlist - PR 5: jobs/rotation-lml-identity-backfill cron + Closes #1380 Refs #1380
Schema constraint shape reportdata-shape report errored (exit 0): node:internal/modules/runmain:107 triggerUncaughtException( ^ Error ERRMODULENOTFOUND: Cannot find package 'postgres' imported from /home/runner/work/Backend-Service/Backend-Service/scripts/schema-shape-report.mjs Did you mean to import "postgres/cjs/src/index.js"? at Object.getPackageJ; manual check required |
This was referenced Jun 14, 2026
Merged
Member
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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.
First in a 5-PR chain implementing #1380. See the issue's Suggested approach section for the full sequence.
Summary
ALTER TABLE rotation ADD COLUMN lml_identity_id integer NULL— stable LML release-identity handle (points atentity.release_identity.idper LML#526). FK semantics live on LML's side; PG-level FK is not enforceable across the network.ALTER TYPE discogs_release_id_source_enum ADD VALUE 'library_identity' AFTER 'discogs_direct_backfill'— new dj-site-side writer that doesn't fit any of the three existing values. Without it, theNOT NULL DEFAULT 'tubafrenzy_paste'would mislabel every dj-site row, corrupting the provenance invariant.Migration is DDL-only with no row UPDATE and no new index. Seqscan-fine at the ~hundreds-of-active-rows scale, matching
jobs/rotation-release-id-backfill/query.ts.What's NOT in this PR
shared/lml-clientresolveIdentitywrapperjobs/rotation-etldrift-prevention CASEapps/backendaddToRotation+pickAddRotationFieldsallowlistjobs/rotation-lml-identity-backfillcron +Closes #1380Test plan
lint:migrations(93 entries, 1 historical-allowlisted warning)@wxyc/databasetypecheckshared/database/src/migrations/**changed)The schema is additive and nullable; existing readers keep working through the transition. Subsequent PRs in the chain consume the column.
Refs #1380