Add the migration for the unique index which helps prevent tag deadlocks.
This commit is contained in:
parent
201943ed1c
commit
3d44416016
2 changed files with 30 additions and 4 deletions
|
@ -0,0 +1,26 @@
|
|||
"""Add a unique index to prevent deadlocks with tags.
|
||||
|
||||
Revision ID: 2b4dc0818a5e
|
||||
Revises: 2b2529fd23ff
|
||||
Create Date: 2015-03-20 23:37:10.558179
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2b4dc0818a5e'
|
||||
down_revision = '2b2529fd23ff'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_index('repositorytag_repository_id_name_lifetime_end_ts', 'repositorytag', ['repository_id', 'name', 'lifetime_end_ts'], unique=True)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index('repositorytag_repository_id_name_lifetime_end_ts', table_name='repositorytag')
|
||||
### end Alembic commands ###
|
Reference in a new issue