Migration file to add unique constraint on user_to_service.

This commit is contained in:
Rebecca Law
2016-02-25 15:16:00 +00:00
parent 67af351f26
commit 42f2065920

View File

@@ -0,0 +1,26 @@
"""empty message
Revision ID: 0024_uix_user_to_service
Revises: 0023_drop_token
Create Date: 2016-02-25 11:15:06.088508
"""
# revision identifiers, used by Alembic.
revision = '0024_uix_user_to_service'
down_revision = '0023_drop_token'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_unique_constraint('uix_user_to_service', 'user_to_service', ['user_id', 'service_id'])
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('uix_user_to_service', 'user_to_service', type_='unique')
### end Alembic commands ###