Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CV2-4600 alter migrations given preexisting indices #422

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions migrations/versions/a836b0be6123_add_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
# Create GIN index
op.create_index('ix_videos_context_gin', 'videos', ['context'], postgresql_using='gin')

# Create partial index for team_id
op.execute('''
Expand All @@ -34,8 +32,6 @@ def upgrade():
ON videos ((context->>'has_custom_id'))
WHERE context->>'has_custom_id' IS NOT NULL;
''')
# Create GIN index
op.create_index('ix_audios_context_gin', 'audios', ['context'], postgresql_using='gin')

# Create partial index for team_id
op.execute('''
Expand All @@ -50,8 +46,6 @@ def upgrade():
ON audios ((context->>'has_custom_id'))
WHERE context->>'has_custom_id' IS NOT NULL;
''')
# Create GIN index
op.create_index('ix_images_context_gin', 'images', ['context'], postgresql_using='gin')

# Create partial index for team_id
op.execute('''
Expand All @@ -75,18 +69,12 @@ def downgrade():
op.drop_index('ix_videos_team_id_partial', table_name='videos')
op.drop_index('ix_videos_has_custom_id_partial', table_name='videos')

# Drop GIN index
op.drop_index('ix_audios_context_gin', table_name='audios')
# Drop partial indexes
op.drop_index('ix_audios_team_id_partial', table_name='audios')
op.drop_index('ix_audios_has_custom_id_partial', table_name='audios')

# Drop GIN index
op.drop_index('ix_audios_context_gin', table_name='audios')
# Drop partial indexes
op.drop_index('ix_images_team_id_partial', table_name='images')
op.drop_index('ix_images_has_custom_id_partial', table_name='images')

# Drop GIN index
op.drop_index('ix_images_context_gin', table_name='images')
# ### end Alembic commands ###
Loading