Files
notifications-api/migrations/versions/0223_add_domain_constraint.py
Chris Hill-Scott f095fa1ddf Add unique constraint to email branding domain
Brandings with a domain set should be considered canonical. It doesn’t
make sense to have the same domain set on multiple different email
brands – you can’t tell which one to use.
2018-09-04 09:46:50 +01:00

21 lines
432 B
Python

"""
Revision ID: 0223_add_domain_constraint
Revises: 0222_drop_service_branding
Create Date: 2018-08-24 13:36:49.346156
"""
from alembic import op
revision = '0223_add_domain_constraint'
down_revision = '0222_drop_service_branding'
def upgrade():
op.create_unique_constraint('uq_email_branding_domain', 'email_branding', ['domain'])
def downgrade():
op.drop_constraint('uq_email_branding_domain', 'email_branding')