-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename trending challenges * Drop challenge migration * Fix lint * Remove extra fmt * Fix test * Fix migration * Fix datetime conversion * Handle double colon * Fix test
- Loading branch information
1 parent
0b0345a
commit 26186a0
Showing
8 changed files
with
71 additions
and
25 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
discovery-provider/alembic/versions/7104383ac0fe_drop_old_trending_challenges.py
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,43 @@ | ||
"""Drop old trending challenges | ||
Revision ID: 7104383ac0fe | ||
Revises: be27a2794f75 | ||
Create Date: 2022-01-14 21:07:15.939210 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "7104383ac0fe" | ||
down_revision = "be27a2794f75" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
connection = op.get_bind() | ||
connection.execute( | ||
""" | ||
--- Drop user challenges | ||
delete from user_challenges | ||
where | ||
challenge_id = 'trending-track' or | ||
challenge_id = 'trending-playlist' or | ||
challenge_id = 'trending-underground-track'; | ||
--- Drop challenges | ||
delete from challenges | ||
where | ||
id = 'trending-track' or | ||
id = 'trending-playlist' or | ||
id = 'trending-underground-track'; | ||
--- Drop trending results | ||
delete from trending_results; | ||
""" | ||
) | ||
|
||
|
||
def downgrade(): | ||
pass |
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
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
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