1 Commits
Author SHA1 Message Date
g-butandClaude Opus 4.7 a8bd89a053 chore(schema): migration 073 drops helper_profiles + 5 Medusa columns; remove now-obsolete TS tombstone comments
User-approved 1-commit scope to finish the schema cleanups that
previously shipped at the TS layer only. Two distinct removals batched
in migration 073 because both are pure deletion + were verified
non-consumer in prior commits:

1. helper_profiles table + helper_profiles_v view. TS declaration
   removed in 0b410106 after Phase 2 migration 061 unified into
   repairer_profiles (profile_tier='community'). Verified zero
   production consumers at TS-removal time; the DB column stayed
   until now for historical preservation.

2. Five Medusa integration columns. TS declarations removed in
   6f0852d8 after grep verified zero consumers anywhere in src/
   (Medusa was an e-commerce framework integration that never
   shipped):
     - ai_extracted_products.medusa_product_id
     - inventory_items.medusa_product_id
     - inventory_items.medusa_variant_id
     - orders.medusa_order_id
     - orders.medusa_cart_id
     - order_items.medusa_variant_id

Migration uses DROP IF EXISTS for both view and columns so it's
idempotent — safe to re-run if a prior partial application happened.

Also removed the now-obsolete tombstone comments that explained the
"TS removed but DB column still present" half-state:
  - src/db/schema/inventory.ts: 3 medusa tombstones, 1 platform-values
    aspirational note
  - src/db/schema/payments.ts: 2 medusa tombstones (orders + order_items)
  - src/db/schema/itHilfe.ts: HELPER PROFILES header block

Migration 073's commit message + git history serve as documentation
of what was dropped; tombstone comments in the live schema added
noise. The two remaining helper_profiles mentions in the codebase
(services.ts:197 "merged from helper_profiles", technicians/[id]/route.ts:5
"formerly helper_profiles") are past-tense historical context and
useful — they stay.

After migration 073 runs:
  - schema, TS code, and DB are all consistent
  - helper_profiles, helper_profiles_v, and the 5 Medusa columns are
    fully gone
  - no behavior change (already verified zero consumers)

59 tests pass across schema-touched suites (db, admin/inventory,
payment-webhook, marketplace); tsc clean.

The 072 migration (token_version add) and 073 migration (this commit's
drops) should both run as part of the same deploy window — 072 is
required for the JWT-stale-permissions code added in commits
ae52f739 / 0be0f55f / 85f6a1f2 to function, and 073 is safe to run
any time since prior commits already removed the TS references.

31 commits this thread. Roadmap's dead-code-deletes section is now
truly complete: 8 false-positives audited, 2 real-positives shipped
(helperProfiles + Medusa), 1 verified-orphan-kept (jobRuns), and the
DB layer now matches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 10:03:44 +02:00