<gh_stars>1-10
"""container stars

Revision ID: 5845d3b8cbdb
Revises: <PASSWORD>
Create Date: 2020-11-25 18:54:37.859303

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('user_stars',
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('container_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['container_id'], ['container.id'], name=op.f('fk_user_stars_container_id_container')),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], name=op.f('fk_user_stars_user_id_user'))
    )
    with op.batch_alter_table('container', schema=None) as batch_op:
        batch_op.drop_column('stars')

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('container', schema=None) as batch_op:
        batch_op.add_column(sa.Column('stars', sa.INTEGER(), nullable=True))

    op.drop_table('user_stars')
    # ### end Alembic commands ###
