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

Migrate with sea_orm::DbConn #49

Merged
merged 2 commits into from
Mar 6, 2022
Merged

Migrate with sea_orm::DbConn #49

merged 2 commits into from
Mar 6, 2022

Conversation

billy1624
Copy link
Member

@billy1624 billy1624 commented Mar 4, 2022

PR Info

Breaking Changes

  • SchemaManager::get_connection method returns &'c DbConn

Changes

  • SchemaManager::conn field is of type &'c DbConn

@billy1624 billy1624 self-assigned this Mar 4, 2022
@billy1624 billy1624 requested a review from tyt2y3 March 4, 2022 06:41
@billy1624 billy1624 marked this pull request as ready for review March 4, 2022 06:54
where
C: ConnectionTrait,
{
async fn up(db: &DbConn, mut steps: Option<u32>) -> Result<(), DbErr> {
Copy link
Member Author

@billy1624 billy1624 Mar 4, 2022

Choose a reason for hiding this comment

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

Later, we could introduce a set of migration operations running on transaction, by beginning a transaction connection from db: &DbConn. The inner operations of it will be the same as the non-transaction counterpart except running migrations on transaction.

CC @tyt2y3

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.

Nice

@tyt2y3 tyt2y3 merged commit d4408a0 into master Mar 6, 2022
@tyt2y3 tyt2y3 deleted the migrate-with-db-conn branch March 6, 2022 15:18
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.

How do you seed data in migrations using ActiveModels?
2 participants