"""Change company description to text.

Revision ID: 6aff43ad8f2a
Revises: 596d0ca91b33
Create Date: 2018-09-05 20:24:21.842837

"""
from alembic import op
import sqlalchemy as sa


from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship

# revision identifiers, used by Alembic.
revision = '6aff43ad8f2a'
down_revision = '596d0ca91b33'

Base = declarative_base()
db = sa
db.Model = Base
db.relationship = relationship


def create_session():
    connection = op.get_bind()
    session_maker = sa.orm.sessionmaker()
    session = session_maker(bind=connection)
    db.session = session


def upgrade():
    create_session()

    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('company', 'description', type_=sa.Text, existing_type=sa.String)

    # ### end Alembic commands ###

def downgrade():
    create_session()

    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('company', 'description', type_=sa.String, existing_type=sa.Text)
    # ### end Alembic commands ###


# vim: ft=python
