Skip to content

[chore] db: drop all current deprecated columns#2626

Merged
Will-Howard merged 1 commit into
masterfrom
wh-2580-drop-deprecated-cols-2026-06
Jun 8, 2026
Merged

[chore] db: drop all current deprecated columns#2626
Will-Howard merged 1 commit into
masterfrom
wh-2580-drop-deprecated-cols-2026-06

Conversation

@Will-Howard

@Will-Howard Will-Howard commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Description

This helps with #2624. There are some stale values in the current postgres db from before these columns were deprecated, which creates a diff between the current and new postgres instance. Dropping these columns will remove this difference, which makes it easier to verify that the contents of the two databases are the same.

Issue

#2624

Developer checklist

@Will-Howard Will-Howard temporarily deployed to wh-2580-drop-deprecated-cols-2026-06 - bluedot-preview PR #2626 June 8, 2026 10:50 — with Render Destroyed
@Will-Howard Will-Howard temporarily deployed to wh-2580-drop-deprecated-cols-2026-06 - bluedot-storybook-preview PR #2626 June 8, 2026 10:50 — with Render Destroyed
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 28c03038-9eb2-4a72-94e4-98f20b7142e5

📥 Commits

Reviewing files that changed from the base of the PR and between 1306ca8 and b8875aa.

📒 Files selected for processing (1)
  • libraries/db/src/schema.ts
💤 Files with no reviewable changes (1)
  • libraries/db/src/schema.ts

📝 Walkthrough

Walkthrough

This pull request removes deprecation metadata from five table definitions in the database schema. The deprecatedColumns sections are deleted from courseTable, unitTable, unitResourceTable, exerciseTable, and courseFeedbackTable. These sections previously tracked Airtable field IDs and deprecation flags for columns marked as obsolete. The changes remove metadata only; no active columns, types, or table exports are modified.

Possibly related PRs

  • bluedotimpact/bluedot#2490: Removes deprecatedColumns metadata from table definitions in the same schema file as part of deprecation cleanup.
  • bluedotimpact/bluedot#2533: Modifies deprecatedColumns handling in unitResourceTable, directly overlapping with the deprecation metadata sections removed in this PR.
  • bluedotimpact/bluedot#2514: Moves unitTable fields into deprecatedColumns, affecting the same deprecation metadata structure that this PR removes.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing deprecated column metadata from the schema file, which aligns with the changeset that removes deprecatedColumns sections from five table definitions.
Description check ✅ Passed The pull request description includes the required sections (Description and Issue) with clear explanations. However, the Developer checklist items appear to be marked as completed without being applicable to this database schema change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wh-2580-drop-deprecated-cols-2026-06

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Will-Howard Will-Howard changed the title [chore] db: drop all remaining deprecated columns [chore] db: drop all current deprecated columns Jun 8, 2026
@Will-Howard Will-Howard marked this pull request as ready for review June 8, 2026 10:53
@greptile-apps

greptile-apps Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes all remaining deprecatedColumns blocks from the db schema to allow the schema-sync service to physically drop those columns from Postgres, closing the stale-data diff between the current and new database instances (part of #2624).

  • Drops 11 deprecated column definitions across courseTable, unitTable, unitResourceTable, exerciseTable, and courseFeedbackTable; no active code references these columns via the typed interface.
  • Once deployed, cleanupRemovedColumns in schema-sync.ts will detect these columns still present in the DB (because pgWithDeprecatedColumns is now undefined for all affected tables) and issue ALTER TABLE … DROP COLUMN statements automatically.

Confidence Score: 5/5

Safe to merge; the schema-only change deliberately removes stale column definitions that are unreferenced by any active code path.

All removed columns were in deprecatedColumns, so they were never exposed through the typed table.pg interface and no production code reads or writes them. The only consumer of pgWithDeprecatedColumns is schema-sync.ts, which falls back to value.pg when the property is absent — exactly the behavior needed to trigger the physical column drops via cleanupRemovedColumns. The change is consistent with the approach taken in the prior PR #2615.

No files require special attention.

Important Files Changed

Filename Overview
libraries/db/src/schema.ts Removes deprecatedColumns entries from 5 tables (courseTable, unitTable, unitResourceTable, exerciseTable, courseFeedbackTable), eliminating 11 deprecated column definitions and triggering their physical drop on the next schema-sync run.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[PR merged: deprecatedColumns removed from schema.ts] --> B[pg-sync-service starts / schema sync triggered]
    B --> C[runDrizzlePush builds pgTables map]
    C --> D{pgWithDeprecatedColumns set?}
    D -- Previously YES --> E[deprecated cols included in expectedColumns]
    D -- Now NO after this PR --> F[only active cols in expectedColumns]
    F --> G[cleanupRemovedColumns compares DB vs schema]
    G --> H[Finds image/path/description/avgRating/etc in DB but not schema]
    H --> I[Issues ALTER TABLE ... DROP COLUMN for each stale column]
    I --> J[pushSchemaWithTimeout runs — no extra diff]
    J --> K[Schema fully in sync with new Postgres instance]
Loading

Reviews (1): Last reviewed commit: "[chore] db: drop all remaining deprecate..." | Re-trigger Greptile

@Will-Howard Will-Howard merged commit 972fed1 into master Jun 8, 2026
7 checks passed
@Will-Howard Will-Howard deleted the wh-2580-drop-deprecated-cols-2026-06 branch June 8, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant