chore: drop invoice schema migration functions - #4732
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
| DROP FUNCTION IF EXISTS om_func_migrate_customer_invoices_to_schema_level_2_bulk(TEXT[]); | ||
| DROP FUNCTION IF EXISTS om_func_migrate_customer_invoices_to_schema_level_2(TEXT); |
There was a problem hiding this comment.
Function Drops Break Active Callers
During a rolling deployment, an older instance can still call the scalar helper after this migration drops it. The current invoice-lock path can likewise call the bulk helper when it encounters a schema-level-1 invoice, so either state produces a PostgreSQL function does not exist error and blocks invoice processing.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tools/migrate/migrations/20260717062143_drop_invoice_schema_migration_functions.up.sql
Line: 1-2
Comment:
**Function Drops Break Active Callers**
During a rolling deployment, an older instance can still call the scalar helper after this migration drops it. The current invoice-lock path can likewise call the bulk helper when it encounters a schema-level-1 invoice, so either state produces a PostgreSQL `function does not exist` error and blocks invoice processing.
How can I resolve this? If you propose a fix, please make it concise.
Overview
Drop the temporary invoice schema migration helper functions after the bulk schema-level-2 backfill has completed.
Note
This PR is intentionally just a collection of cleanups to be merged later. Keep it open until the bulk backfill has been deployed and older OpenMeter versions that still call the scalar function are no longer in use.
This PR is stacked on top of #4729.
Changes
om_func_migrate_customer_invoices_to_schema_level_2(TEXT).om_func_migrate_customer_invoices_to_schema_level_2_bulk(TEXT[]).Validation
atlas migrate --env local lint --latest 1atlas migrate validate --env localgit diff --checkGreptile Summary
This PR removes the completed invoice schema migration helpers. The main changes are:
Confidence Score: 4/5
The function-removal migration can break invoice processing while scalar or bulk callers remain deployable.
tools/migrate/migrations/20260717062143_drop_invoice_schema_migration_functions.up.sql
Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "chore: drop invoice schema migration fun..." | Re-trigger Greptile
Context used: