Replace `getRepository(Media)` calls with `event.manager` in the `afterRemove` hook so that parent-media status resets run within the same transaction/QueryRunner (important for postgresql. Doesnt affect sqlite).
Replace `getRepository(Media)` calls with `event.manager` in the `afterRemove` hook so that parent-media status resets run within the same transaction/QueryRunner (important for postgresql. Doesnt affect sqlite).