This repository has been archived by the owner on Aug 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor backend binding to room (#187)
- Loading branch information
1 parent
a56ad3d
commit 1c27500
Showing
10 changed files
with
304 additions
and
386 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
migrations/2020-11-25-100717_move_backend_id_to_room_from_recording/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ALTER TABLE recording ADD COLUMN backend_id agent_id; | ||
|
||
UPDATE recording AS rec | ||
SET backend_id = r.backend_id | ||
FROM rtc, | ||
room AS r | ||
WHERE rtc.id = rec.rtc_id | ||
AND r.id = rtc.room_id | ||
AND r.backend = 'janus'; | ||
|
||
ALTER TABLE room DROP COLUMN backend_id; |
15 changes: 15 additions & 0 deletions
15
migrations/2020-11-25-100717_move_backend_id_to_room_from_recording/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ALTER TABLE room ADD COLUMN backend_id agent_id; | ||
|
||
ALTER TABLE room | ||
ADD CONSTRAINT room_backend_id_check | ||
CHECK (backend_id IS NULL OR backend = 'janus'); | ||
|
||
UPDATE room AS r | ||
SET backend_id = rec.backend_id | ||
FROM rtc, | ||
recording AS rec | ||
WHERE rtc.room_id = r.id | ||
AND rec.rtc_id = rtc.id | ||
AND r.backend = 'janus'; | ||
|
||
ALTER TABLE recording DROP COLUMN backend_id; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.