"""empty message

Revision ID: 0048 add book_to_order
Revises: 0047 add smtp
Create Date: 2020-11-28 00:20:17.353955

"""

# revision identifiers, used by Alembic.
revision = '0048 add book_to_order'
down_revision = '0047 add smtp'

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

def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('book_to_order',
    sa.Column('book_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('order_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('quantity', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['book_id'], ['books.id'], ),
    sa.ForeignKeyConstraint(['order_id'], ['orders.id'], ),
    sa.PrimaryKeyConstraint('book_id', 'order_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('book_to_order')
    # ### end Alembic commands ###
