+
Skip to content

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

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载