30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
|
"""Add missing indexes
|
||
|
|
||
|
Revision ID: 790d91952fa8
|
||
|
Revises: 1093d8b212bb
|
||
|
Create Date: 2016-08-03 17:05:06.675520
|
||
|
|
||
|
"""
|
||
|
|
||
|
# revision identifiers, used by Alembic.
|
||
|
revision = '790d91952fa8'
|
||
|
down_revision = '1093d8b212bb'
|
||
|
|
||
|
from alembic import op
|
||
|
import sqlalchemy as sa
|
||
|
|
||
|
def upgrade(tables):
|
||
|
### commands auto generated by Alembic - please adjust! ###
|
||
|
op.create_index('repositorybuild_repository_id_started_phase', 'repositorybuild', ['repository_id', 'started', 'phase'], unique=False)
|
||
|
op.create_index('repositorybuild_started', 'repositorybuild', ['started'], unique=False)
|
||
|
op.create_index('repositorybuild_started_logs_archived_phase', 'repositorybuild', ['started', 'logs_archived', 'phase'], unique=False)
|
||
|
### end Alembic commands ###
|
||
|
|
||
|
|
||
|
def downgrade(tables):
|
||
|
### commands auto generated by Alembic - please adjust! ###
|
||
|
op.drop_index('repositorybuild_started_logs_archived_phase', table_name='repositorybuild')
|
||
|
op.drop_index('repositorybuild_started', table_name='repositorybuild')
|
||
|
op.drop_index('repositorybuild_repository_id_started_phase', table_name='repositorybuild')
|
||
|
### end Alembic commands ###
|