<gh_stars>0
"""Log(logs) n-1 (owner)User relation

Revision ID: a07ff3082ff2
Revises: 8c1cd2<PASSWORD>
Create Date: 2019-09-11 15:24:58.283268

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a07ff3082ff2'
down_revision = '8c1cd2e50d9c'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("logs") as batch_op:
        batch_op.add_column(sa.Column('owner_id', sa.Integer(), nullable=False))
        batch_op.create_foreign_key('logs', 'users', ['owner_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("logs") as batch_op:
        batch_op.drop_constraint('logs', type_='foreignkey')
        batch_op.drop_column('owner_id')
    # ### end Alembic commands ###
