mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-10 10:03:38 -04:00
Migration file to add unique constraint on user_to_service.
This commit is contained in:
26
migrations/versions/0024_uix_user_to_service.py
Normal file
26
migrations/versions/0024_uix_user_to_service.py
Normal 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 ###
|
||||||
Reference in New Issue
Block a user