Give songwriter and producer roster members artist accounts

Merged
SI
5d ago
+214-6

Adding a songwriter or producer currently saves a professional record without an artist account, leaving that person absent from the artist roster picker and account-based workflows. Create the account, profile, roster links, roles and retry receipt in one transaction using the existing artist creation function. Existing professional IDs retain their artist identity and can restore roster membership.

The forward migration adds a required artist_id referencing accounts.id, backfills legacy records, and extends old receipts without changing their role snapshots. It explicitly links the confirmed Sidney Swift professional to his existing artist account; guarded prerequisites abort if that mapping has changed. Other legacy records receive distinct organization-owned accounts. No name-based merging, creator-ID rename, enrichment, or catalog/royalty assignments.

Validation: 40 disposable PostgreSQL roster tests passed, including concurrent retries, rollback, revoked access, real artist-roster queries, legacy receipt replay, and the guarded existing-account repair. The new-account and reattachment regressions failed before the fix. No production migration has been applied.

Rollout: apply this migration before the API response-schema and app refresh changes on codex/professional-artist-accounts. Keep the additive schema on app/API rollback; the previous role-only INSERT cannot satisfy the required account link.


Summary by cubic

Songwriter and producer roster members now get artist accounts, so they appear in the artist roster picker and account-based workflows instead of existing only as professional records.

The migration adds a required artist_id linking professionals to existing accounts, backfills legacy records, and extends saved receipts with the account link without altering role snapshots. New confirmations create the account, profile, roster links, roles, and receipt in a single transaction. A guarded block links the confirmed Sidney Swift professional to his existing artist account; other legacy records receive distinct organization-owned accounts. No name-based merging, renaming, or catalog/royalty assignments.

Migration

  • Apply 20261023160000_professional_artist_accounts.sql before the API and app changes on codex/professional-artist-accounts.
  • Keep the additive schema on app/API rollback; reverting to role-only inserts would violate the required account link.