Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/migration module #496

Merged
merged 6 commits into from
Jan 2, 2025
Merged

Feat/migration module #496

merged 6 commits into from
Jan 2, 2025

Conversation

marrouchi
Copy link
Contributor

@marrouchi marrouchi commented Jan 2, 2025

Motivation

This PR introduces the new migration module to Hexabot, providing a robust and streamlined approach to manage database migrations. The module simplifies schema updates by allowing developers to create, execute, and roll back migrations while ensuring synchronization with the database state.

Key Features:
• Automatic generation of timestamped migration files in kebab-case.
• Tracks migration execution status in a MongoDB migrations collection.
• CLI commands for creating, running, and rolling back migrations (individual or all).
• Built-in rollback logic for reliable undoing of changes.
• Auto-apply migrations in development environments when config.mongo.autoMigrate is enabled.

Check the module README for more.

Type of change:

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@marrouchi marrouchi linked an issue Jan 2, 2025 that may be closed by this pull request
@marrouchi marrouchi force-pushed the feat/migration-module branch from b723432 to 5c54573 Compare January 2, 2025 15:03
@marrouchi marrouchi merged commit ad45a70 into main Jan 2, 2025
5 checks passed
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.

Add a migration module
2 participants