Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove pkey constraint on stems and remixes (#994)
- Loading branch information
1 parent
dfa2080
commit e0274b6
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
discovery-provider/alembic/versions/d579207034fc_remove_stems_and_remixes_unique_.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,32 @@ | ||
"""remove_stems_and_remixes_unique_constraints | ||
Revision ID: d579207034fc | ||
Revises: 281de8af4b93 | ||
Create Date: 2020-10-26 21:25:20.393863 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'd579207034fc' | ||
down_revision = '281de8af4b93' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
connection = op.get_bind() | ||
connection.execute(''' | ||
ALTER TABLE stems | ||
DROP CONSTRAINT IF EXISTS stems_pkey | ||
''') | ||
connection.execute(''' | ||
ALTER TABLE remixes | ||
DROP CONSTRAINT IF EXISTS remixes_pkey | ||
''') | ||
|
||
def downgrade(): | ||
op.create_primary_key('stems_pkey', 'stems', ['parent_track_id', 'child_track_id']) | ||
op.create_primary_key('remixes_pkey', 'remixes', ['parent_track_id', 'child_track_id']) |