Fix error when deleting rooms containing projects on refresh
A foreign key violation was causing the server to never delete stale rooms during `Database::refresh_room` due to having one or more project records referencing the room.
This commit is contained in:
parent
e74db2d180
commit
bbeb33bc7e
3 changed files with 20 additions and 5 deletions
|
@ -191,6 +191,10 @@ impl Database {
|
|||
.filter(room_participant::Column::RoomId.eq(room_id))
|
||||
.exec(&*tx)
|
||||
.await?;
|
||||
project::Entity::delete_many()
|
||||
.filter(project::Column::RoomId.eq(room_id))
|
||||
.exec(&*tx)
|
||||
.await?;
|
||||
room::Entity::delete_by_id(room_id).exec(&*tx).await?;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue