chore(db): drop orphaned import_* columns from user_table_definitions

Merged
WA
2mo ago
+20337-0

Summary

  • Drops the five orphaned import_* columns from user_table_definitions — import_status, import_id, import_error, import_rows_processed, import_started_at
  • This is the contract phase of the table-jobs cutover. Migration 0233 moved import job state into table_jobs and removed every application read and write, but deliberately left the columns in place so the then-deployed app version kept working across blue/green cutover. The follow-up drop was never written, and no contract-pending marker was left to track it
  • The columns have been invisible to Drizzle ever since: the model lost them in the same release, so every meta snapshot from 0233 onward already omits them and drizzle-kit generate reports no diff. They exist only physically, which is why this is a custom migration
  • schema.ts is intentionally untouched — it has been correct since the cutover; only the database was stale

Type of Change

  • Chore / cleanup

Testing

  • Verified zero references to any of the five column names (snake_case or camelCase) anywhere outside packages/db/migrations
  • Confirmed all five columns are empty across every row in production, and that nothing depends on them — no index, constraint, view, rule, trigger, function, publication, or generated column
  • Diffed every table's column count against the Drizzle snapshot: user_table_definitions is the only table with model/database drift
  • Idempotency tested against a scratch Postgres — ran the migration three times, clean each run, row data intact. Single ALTER with DROP COLUMN IF EXISTS clauses, so one lock acquisition and a no-op replay after a lock_timeout retry
  • bun run check:migrations origin/staging ✓, bun run lint ✓, bun run check:audits (37 audits) ✓

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)