<filename>migrations/versions/ae899a714e42_.py
"""empty message

Revision ID: <KEY>
Revises: 6ba9a47dc242
Create Date: 2020-02-13 13:07:40.372800

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

# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '6ba9a47dc242'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user_group_chat_log', sa.Column('user_id', sa.Integer(), nullable=True))
    op.drop_constraint('user_group_chat_log_ibfk_2', 'user_group_chat_log', type_='foreignkey')
    op.create_foreign_key(None, 'user_group_chat_log', 'user', ['user_id'], ['id'])
    op.drop_column('user_group_chat_log', 'to_user')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user_group_chat_log', sa.Column('to_user', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'user_group_chat_log', type_='foreignkey')
    op.create_foreign_key('user_group_chat_log_ibfk_2', 'user_group_chat_log', 'user', ['to_user'], ['id'])
    op.drop_column('user_group_chat_log', 'user_id')
    # ### end Alembic commands ###

<filename>migrations/versions/ae899a714e42_.py
"""empty message

Revision ID: <KEY>
Revises: 6ba9a47dc242
Create Date: 2020-02-13 13:07:40.372800

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

# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '6ba9a47dc242'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user_group_chat_log', sa.Column('user_id', sa.Integer(), nullable=True))
    op.drop_constraint('user_group_chat_log_ibfk_2', 'user_group_chat_log', type_='foreignkey')
    op.create_foreign_key(None, 'user_group_chat_log', 'user', ['user_id'], ['id'])
    op.drop_column('user_group_chat_log', 'to_user')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user_group_chat_log', sa.Column('to_user', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'user_group_chat_log', type_='foreignkey')
    op.create_foreign_key('user_group_chat_log_ibfk_2', 'user_group_chat_log', 'user', ['to_user'], ['id'])
    op.drop_column('user_group_chat_log', 'user_id')
    # ### end Alembic commands ###

empty message  Revision ID: <KEY> Revises: 6ba9a47dc242 Create Date: 2020-02-13 13:07:40.372800 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###