Skip to content

Conversation

crbelaus
Copy link
Contributor

@crbelaus crbelaus commented Jun 5, 2024

This commit introduces an Oban like migration system for the ErrorTracker. Users can generate their own migrations that call the ErrorTracker migrations and possibly set an alternative database prefix in case that they want to store the errors in a separate schema than the rest of the application.

This commit also updates the dev script to showcase how to use the new migration system on an alternative prefix.


Keeping track of the current schema version is not an easy task as we cannot rely on the regular schema_migrations table that Ecto creates. Instead I've followed Oban steps and recorded the current schema version in the table description.

This is read before running the migrations and updated after, so subsequent migrations can know which version to start from.

This commit introduces an Oban like migration system for the ErrorTracker.
Users can generate their own migrations that call the ErrorTracker
migrations and possibly set an alternative database prefix in case that
they want to store the errors in a separate schema than the rest of the
application.

This commit also updates the dev script to showcase how to use the new
migration system on an alternative prefix.
@crbelaus crbelaus requested a review from odarriba June 5, 2024 17:27
Copy link
Contributor

@odarriba odarriba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added some comments but overall looks fantastic 🌠

@crbelaus crbelaus merged commit 55842e6 into main Jun 8, 2024
@crbelaus crbelaus deleted the oban-like-migrations branch June 8, 2024 06:31
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.

2 participants