Create migration table `seaql_migrations` in the database
(db: &C)
| 161 | |
| 162 | /// Create migration table `seaql_migrations` in the database |
| 163 | async fn install<C>(db: &C) -> Result<(), DbErr> |
| 164 | where |
| 165 | C: ConnectionTrait, |
| 166 | { |
| 167 | let builder = db.get_database_backend(); |
| 168 | let table_name = Self::migration_table_name(); |
| 169 | let schema = Schema::new(builder); |
| 170 | let mut stmt = schema |
| 171 | .create_table_from_entity(seaql_migrations::Entity) |
| 172 | .table_name(table_name); |
| 173 | stmt.if_not_exists(); |
| 174 | db.execute(builder.build(&stmt)).await.map(|_| ()) |
| 175 | } |
| 176 | |
| 177 | /// Check the status of all migrations |
| 178 | async fn status<C>(db: &C) -> Result<(), DbErr> |
nothing calls this directly
no test coverage detected