MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / get_migration_models

Method get_migration_models

sea-orm-migration/src/migrator.rs:81–95  ·  view source on GitHub ↗

Get list of applied migrations from database

(db: &C)

Source from the content-addressed store, hash-verified

79
80 /// Get list of applied migrations from database
81 async fn get_migration_models<C>(db: &C) -> Result<Vec<seaql_migrations::Model>, DbErr>
82 where
83 C: ConnectionTrait,
84 {
85 Self::install(db).await?;
86 let stmt = Query::select()
87 .table_name(Self::migration_table_name())
88 .columns(seaql_migrations::Column::iter().map(IntoIden::into_iden))
89 .order_by(seaql_migrations::Column::Version, Order::Asc)
90 .to_owned();
91 let builder = db.get_database_backend();
92 seaql_migrations::Model::find_by_statement(builder.build(&stmt))
93 .all(db)
94 .await
95 }
96
97 /// Get list of migrations with status
98 async fn get_migration_with_status<C>(db: &C) -> Result<Vec<Migration>, DbErr>

Callers

nothing calls this directly

Implementers 15

lib.rssea-orm-cli/template/migration/src/lib
default.rssea-orm-migration/tests/common/migrato
override_migration_table_name.rssea-orm-migration/tests/common/migrato
lib.rsexamples/loco_seaography/migration/src
lib.rsexamples/seaography_example/migration/
lib.rsexamples/jsonrpsee_example/seeder/src/
lib.rsexamples/jsonrpsee_example/migration/s
lib.rsexamples/tonic_example/migration/src/l
lib.rsexamples/graphql_example/seeder/src/li
lib.rsexamples/graphql_example/migration/src
lib.rsexamples/axum_example/seeder/src/lib.r
lib.rsexamples/axum_example/migration/src/li

Calls 6

order_byMethod · 0.80
columnsMethod · 0.80
table_nameMethod · 0.45
get_database_backendMethod · 0.45
allMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected