improvement(db): finish workspace file size cutover - #7112
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
faf3980 to
c3960be
Compare
Greptile SummaryThe PR completes the workspace-file size cutover from the legacy integer field to the canonical bigint field.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/db/migrations/0308_workspace_file_size_cutover.sql | Adds rolling-deployment compatibility between the legacy integer size and canonical bigint size. |
| packages/db/script-migrations/0008_backfill_workspace_file_size_bytes.ts | Implements an idempotent, keyset-paginated backfill with independently committed batches. |
| packages/db/scripts/apply-dev-workspace-file-size-cutover.ts | Applies compatibility SQL and the canonical-size backfill to existing dev databases before recording completion. |
| .github/workflows/migrations.yml | Runs the temporary cutover after the dev schema push. |
| packages/db/schema.ts | Makes size_bytes the canonical application field while retaining the legacy size column for rollout compatibility. |
| apps/sim/lib/billing/storage/payer-transfer.ts | Recomputes payer-transfer storage totals from the canonical bigint size column. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Apply schema changes] --> B[Install size synchronization trigger]
B --> C[Backfill null size_bytes rows in bounded batches]
C --> D[Record script migration completion]
D --> E[Deploy canonical size_bytes readers and writers]
E --> F[Remove compatibility artifacts after rollout]
Reviews (4): Last reviewed commit: "fix(db): fail closed on missing file siz..." | Re-trigger Greptile
There was a problem hiding this comment.
All reported issues were addressed
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
|
@cubic review |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 35 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
Summary
workspace_files.size_bytesin bounded, resumable batches and keep old/new writers compatible during rolloutType of Change
Testing
Tested with lint, the full audit suite, migration safety checks, app/database type-checks, targeted app and migration tests, and an isolated PostgreSQL 17 migration run.
Checklist