Remove temporary migration

This commit is contained in:
Niels Andriesse 2021-04-29 11:43:09 +10:00
parent 3d5dbfe981
commit b0c2b6d4d5
1 changed files with 1 additions and 18 deletions

View File

@ -289,24 +289,7 @@ pub async fn prune_files(file_expiration: i64) {
// Migration
pub fn perform_migration() {
let rooms = match get_all_room_ids() {
Ok(rooms) => rooms,
Err(_) => return,
};
for room in rooms {
let pool = pool_by_room_id(&room);
let conn = match pool.get() {
Ok(conn) => conn,
Err(e) => return error!("Couldn't perform migration due to error: {}.", e),
};
let stmt = format!("ALTER TABLE {} ADD is_deleted INTEGER", MESSAGES_TABLE);
match conn.execute(&stmt, params![]) {
Ok(_) => (),
Err(e) => return error!("Couldn't perform migration due to error: {}.", e),
};
// Log the result
info!("Successfully performed migration for room: {}.", room);
}
// Do nothing
}
// Utilities