Why are we doing this?
We are making these changes to:- Ensure data consistency by aligning
billing_entity_sequential_id
withorganization_sequential_id
in invoices - Prepare for upcoming features that will rely on consistent sequential IDs across the system
What are the changes?
Populating billing_entity_sequential_id
in invoices
We’re introducing a data migration to ensure that billing_entity_sequential_id
matches organization_sequential_id
for all invoices. This change will maintain data consistency and prepare the system for future enhancements.
What should self-hosted users do?
Cloud users do not need to follow these instructions, as the migration will be performed by the Lago Team.
If you’re upgrading to v1.28.1, you must complete all the migration steps below to ensure data consistency and proper functionality.
Migration Steps
- Install the new version of Lago (v1.28.1)
-
Open the Rails console on your API server:
-
Run the following command:
All invoices are processed in background jobs, with 1000 invoices per batch. You can monitor the progress in the Sidekiq console by checking the batch number argument in the job details.Wait for all jobs in Sidekiq to be executed.You can verify that the job is fully executed by running:Expected processing speed is at least 1-2 seconds per 1K invoices. The actual time may vary depending on your system’s resources and database size.This should return 0 when all invoices have been processed.