"""convert char(n) to text

Revision ID: ce05198f524a
Revises: b84bdc5d3c67
Create Date: 2021-06-26 08:33:25.798948

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'ce05198f524a'
down_revision = 'b84bdc5d3c67'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('agents', 'address',
               existing_type=sa.VARCHAR(length=25),
               type_=sa.UnicodeText(),
               existing_nullable=False)
    op.alter_column('agents', 'ip_address',
               existing_type=sa.VARCHAR(length=50),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('agents', 'name',
               existing_type=sa.VARCHAR(length=50),
               type_=sa.UnicodeText(),
               existing_nullable=False)
    op.alter_column('agents_groups', 'name',
               existing_type=sa.VARCHAR(length=50),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('branches', 'branch_name',
               existing_type=sa.VARCHAR(length=255),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('branches', 'name',
               existing_type=sa.VARCHAR(length=255),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('files', 'path',
               existing_type=sa.VARCHAR(length=512),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('flows', 'branch_name',
               existing_type=sa.VARCHAR(length=255),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('flows', 'label',
               existing_type=sa.VARCHAR(length=200),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('issues', 'message',
               existing_type=sa.VARCHAR(length=512),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('issues', 'path',
               existing_type=sa.VARCHAR(length=512),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('issues', 'symbol',
               existing_type=sa.VARCHAR(length=64),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('jobs', 'name',
               existing_type=sa.VARCHAR(length=200),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('jobs', 'notes',
               existing_type=sa.VARCHAR(length=2048),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('projects', 'description',
               existing_type=sa.VARCHAR(length=200),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('projects', 'name',
               existing_type=sa.VARCHAR(length=50),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('runs', 'label',
               existing_type=sa.VARCHAR(length=200),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('secrets', 'name',
               existing_type=sa.VARCHAR(length=255),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('settings', 'group',
               existing_type=sa.VARCHAR(length=50),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('settings', 'name',
               existing_type=sa.VARCHAR(length=50),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('settings', 'val_type',
               existing_type=sa.VARCHAR(length=8),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('stages', 'description',
               existing_type=sa.VARCHAR(length=1024),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('stages', 'name',
               existing_type=sa.VARCHAR(length=50),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('systems', 'executor',
               existing_type=sa.VARCHAR(length=20),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('systems', 'name',
               existing_type=sa.VARCHAR(length=150),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('test_cases', 'name',
               existing_type=sa.VARCHAR(length=255),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('tools', 'description',
               existing_type=sa.VARCHAR(length=200),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('tools', 'name',
               existing_type=sa.VARCHAR(length=50),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('user_sessions', 'token',
               existing_type=sa.VARCHAR(length=32),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('users', 'name',
               existing_type=sa.VARCHAR(length=50),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    op.alter_column('users', 'password',
               existing_type=sa.VARCHAR(length=150),
               type_=sa.UnicodeText(),
               existing_nullable=True)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('users', 'password',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=150),
               existing_nullable=True)
    op.alter_column('users', 'name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=50),
               existing_nullable=True)
    op.alter_column('user_sessions', 'token',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=32),
               existing_nullable=True)
    op.alter_column('tools', 'name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=50),
               existing_nullable=True)
    op.alter_column('tools', 'description',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=200),
               existing_nullable=True)
    op.alter_column('test_cases', 'name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=255),
               existing_nullable=True)
    op.alter_column('systems', 'name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=150),
               existing_nullable=True)
    op.alter_column('systems', 'executor',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=20),
               existing_nullable=True)
    op.alter_column('stages', 'name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=50),
               existing_nullable=True)
    op.alter_column('stages', 'description',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=1024),
               existing_nullable=True)
    op.alter_column('settings', 'val_type',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=8),
               existing_nullable=True)
    op.alter_column('settings', 'name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=50),
               existing_nullable=True)
    op.alter_column('settings', 'group',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=50),
               existing_nullable=True)
    op.alter_column('secrets', 'name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=255),
               existing_nullable=True)
    op.alter_column('runs', 'label',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=200),
               existing_nullable=True)
    op.alter_column('projects', 'name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=50),
               existing_nullable=True)
    op.alter_column('projects', 'description',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=200),
               existing_nullable=True)
    op.alter_column('jobs', 'notes',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=2048),
               existing_nullable=True)
    op.alter_column('jobs', 'name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=200),
               existing_nullable=True)
    op.alter_column('issues', 'symbol',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=64),
               existing_nullable=True)
    op.alter_column('issues', 'path',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=512),
               existing_nullable=True)
    op.alter_column('issues', 'message',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=512),
               existing_nullable=True)
    op.alter_column('flows', 'label',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=200),
               existing_nullable=True)
    op.alter_column('flows', 'branch_name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=255),
               existing_nullable=True)
    op.alter_column('files', 'path',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=512),
               existing_nullable=True)
    op.alter_column('branches', 'name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=255),
               existing_nullable=True)
    op.alter_column('branches', 'branch_name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=255),
               existing_nullable=True)
    op.alter_column('agents_groups', 'name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=50),
               existing_nullable=True)
    op.alter_column('agents', 'name',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=50),
               existing_nullable=False)
    op.alter_column('agents', 'ip_address',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=50),
               existing_nullable=True)
    op.alter_column('agents', 'address',
               existing_type=sa.UnicodeText(),
               type_=sa.VARCHAR(length=25),
               existing_nullable=False)
    # ### end Alembic commands ###
