Make branding type non-nullable

We’ve already removed all the `null` values, and made it impossible to
add new brandings with a `null` brand type.

Making it a database constraint just gives us extra safety.
This commit is contained in:
Chris Hill-Scott
2018-08-29 12:25:57 +01:00
parent de396ebec9
commit 11225b7149

View File

@@ -0,0 +1,17 @@
"""
Revision ID: 0220_email_brand_type_non_null
Revises: 0219_default_email_branding
Create Date: 2018-08-24 13:36:49.346156
"""
from alembic import op
revision = '0220_email_brand_type_non_null'
down_revision = '0219_default_email_branding'
def upgrade():
op.alter_column('email_branding', 'brand_type', nullable=False)
def downgrade():
op.alter_column('email_branding', 'brand_type', nullable=True)