Get list of applied migrations from database
(db: &C)
| 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> |
nothing calls this directly
no test coverage detected