"""Create lr_uprn column with a GIN index

Revision ID: 45a35ac9bfe
Revises: 2bbd8de7dcb
Create Date: 2015-09-22 10:36:04.307515

"""

# revision identifiers, used by Alembic.
revision = '45a35ac9bfe'
down_revision = '2bbd8de7dcb'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('title_register_data', sa.Column('lr_uprns', postgresql.ARRAY(sa.String()), nullable=False))
    op.create_index('idx_title_uprns', 'title_register_data', ['lr_uprns'], unique=False, postgresql_using='gin')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('idx_title_uprns', table_name='title_register_data')
    op.drop_column('title_register_data', 'lr_uprns')
    ### end Alembic commands ###

"""Create lr_uprn column with a GIN index

Revision ID: 45a35ac9bfe
Revises: 2bbd8de7dcb
Create Date: 2015-09-22 10:36:04.307515

"""

# revision identifiers, used by Alembic.
revision = '45a35ac9bfe'
down_revision = '2bbd8de7dcb'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('title_register_data', sa.Column('lr_uprns', postgresql.ARRAY(sa.String()), nullable=True))
    op.create_index('idx_title_uprns', 'title_register_data', ['lr_uprns'], unique=False, postgresql_using='gin')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('idx_title_uprns', table_name='title_register_data')
    op.drop_column('title_register_data', 'lr_uprns')
    ### end Alembic commands ###

Fix not nullable field for lr-uprns to be nullable