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

Fix the handling of new mod files. #2064

Merged
merged 1 commit into from
Feb 28, 2024
Merged

Conversation

ryankopf
Copy link
Contributor

PR Info

When running a migration, such as:

sea-orm-cli migrate generate create_users_table

The command will panic! if there are no existing migrations already in the mod.rs file. However if this is the very first migration generated, then this is undesirable behavior. This PR fixes the problem by checking if the regex has any matches before unwrapping, otherwise it will append to the end of the mod.rs file.

Bug Fixes

Replaces an unwrap statement with a match condition, handling the problem.

Copy link
Member

@tyt2y3 tyt2y3 left a comment

Choose a reason for hiding this comment

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

Thank you!

@tyt2y3 tyt2y3 merged commit 8025199 into SeaQL:master Feb 28, 2024
Copy link

github-actions bot commented Aug 4, 2024

🎉 Released In 1.0.0 🎉

Thank you everyone for the contribution!
This feature is now available in the latest release. Now is a good time to upgrade!
Your participation is what makes us unique; your adoption is what drives us forward.
You can support SeaQL 🌊 by starring our repos, sharing our libraries and becoming a sponsor ⭐.

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