"""empty message

Revision ID: f8159c65f1be
Revises: 56d294034b42
Create Date: 2019-01-30 20:18:11.935003

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

# revision identifiers, used by Alembic.
revision = 'f8159c65f1be'
down_revision = '56d294034b42'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('assets', sa.Column('created', sa.TIMESTAMP(), server_default=sa.text(u'CURRENT_TIMESTAMP'), nullable=False))
    op.add_column('assets', sa.Column('url', sa.String(length=1000), nullable=False))
    op.drop_column('assets', 'data')
    op.add_column('tags', sa.Column('created', sa.TIMESTAMP(), server_default=sa.text(u'CURRENT_TIMESTAMP'), nullable=False))
    op.add_column('tags', sa.Column('image', sa.String(length=150), nullable=True))
    op.drop_column('tags', 'creation_date')
    op.alter_column('users', 'avatar',
               existing_type=sa.VARCHAR(length=300),
               nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('users', 'avatar',
               existing_type=sa.VARCHAR(length=300),
               nullable=True)
    op.add_column('tags', sa.Column('creation_date', postgresql.TIMESTAMP(), server_default=sa.text(u'CURRENT_TIMESTAMP'), autoincrement=False, nullable=False))
    op.drop_column('tags', 'image')
    op.drop_column('tags', 'created')
    op.add_column('assets', sa.Column('data', sa.VARCHAR(length=1000), autoincrement=False, nullable=False))
    op.drop_column('assets', 'url')
    op.drop_column('assets', 'created')
    # ### end Alembic commands ###
