mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Make name and filename fields of DVLAOrganisation non-nullable
If either of these fields are null, previewing a letter template won't work.
This commit is contained in:
23
migrations/versions/0240_dvla_org_non_nullable.py
Normal file
23
migrations/versions/0240_dvla_org_non_nullable.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
|
||||
Revision ID: 0240_dvla_org_non_nullable
|
||||
Revises: 0239_add_edit_folder_permission
|
||||
Create Date: 2018-10-25 09:16:54.602182
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision = '0240_dvla_org_non_nullable'
|
||||
down_revision = '0239_add_edit_folder_permission'
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.alter_column('dvla_organisation', 'filename', existing_type=sa.VARCHAR(length=255), nullable=False)
|
||||
op.alter_column('dvla_organisation', 'name', existing_type=sa.VARCHAR(length=255), nullable=False)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.alter_column('dvla_organisation', 'name', existing_type=sa.VARCHAR(length=255), nullable=True)
|
||||
op.alter_column('dvla_organisation', 'filename', existing_type=sa.VARCHAR(length=255), nullable=True)
|
||||
Reference in New Issue
Block a user