Skip to content

Commit

Permalink
Added more indexes to tables
Browse files Browse the repository at this point in the history
  • Loading branch information
romanchyla committed Nov 5, 2018
1 parent 2c5aa6d commit 3bb8267
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions alembic/versions/c619e555696_adding_indexes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Adding indexes
Revision ID: c619e555696
Revises: 45eb49b7e934
Create Date: 2018-11-05 17:17:08.553335
"""

# revision identifiers, used by Alembic.
revision = 'c619e555696'
down_revision = '45eb49b7e934'

from alembic import op
import sqlalchemy as sa




def upgrade():
op.create_index('oauth2token_client_id_key', 'oauth2token', ['client_id'])
op.create_index('oauth2token_user_id_key', 'oauth2token', ['user_id'])
op.create_index('oauth2token_is_personal_key', 'oauth2token', ['is_personal'])

op.create_index('oauth2client_user_id_key', 'oauth2client', ['user_id'])
op.create_index('oauth2client_name_key', 'oauth2client', ['name'])

def downgrade():
op.drop_index('oauth2token_client_id_key', 'oauth2token')
op.drop_index('oauth2token_user_id_key', 'oauth2token')
op.drop_index('oauth2token_is_personal_key', 'oauth2token')

op.drop_index('oauth2client_user_id_key', 'oauth2client')
op.drop_index('oauth2client_name_key', 'oauth2client')

0 comments on commit 3bb8267

Please sign in to comment.