"""empty message

Revision ID: 3737ae936621
Revises: 
Create Date: 2020-06-28 16:43:34.247352

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3737ae936621'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('author',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('surname', sa.String(length=128), nullable=True),
    sa.Column('other_names', sa.String(length=128), nullable=True),
    sa.Column('white_author', sa.Boolean(), nullable=True),
    sa.Column('author_gender', sa.String(length=32), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_author_surname'), 'author', ['surname'], unique=False)
    op.create_table('series',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('name', sa.String(length=128), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_series_name'), 'series', ['name'], unique=False)
    op.create_table('book',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('title', sa.String(length=128), nullable=True),
    sa.Column('genre', sa.String(length=128), nullable=True),
    sa.Column('awards', sa.String(length=128), nullable=True),
    sa.Column('series_id_fk', sa.Integer(), nullable=True),
    sa.Column('series_order', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['series_id_fk'], ['series.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_book_title'), 'book', ['title'], unique=False)
    op.create_table('book_author_association',
    sa.Column('author_id_fk', sa.Integer(), nullable=False),
    sa.Column('book_id_fk', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['author_id_fk'], ['author.id'], ),
    sa.ForeignKeyConstraint(['book_id_fk'], ['book.id'], ),
    sa.PrimaryKeyConstraint('author_id_fk', 'book_id_fk')
    )
    op.create_table('reading',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('book_id_fk', sa.Integer(), nullable=True),
    sa.Column('date', sa.Date(), nullable=True),
    sa.Column('rating', sa.Integer(), nullable=True),
    sa.Column('reread', sa.Boolean(), nullable=True),
    sa.Column('manner', sa.String(length=32), nullable=True),
    sa.ForeignKeyConstraint(['book_id_fk'], ['book.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('reading')
    op.drop_table('book_author_association')
    op.drop_index(op.f('ix_book_title'), table_name='book')
    op.drop_table('book')
    op.drop_index(op.f('ix_series_name'), table_name='series')
    op.drop_table('series')
    op.drop_index(op.f('ix_author_surname'), table_name='author')
    op.drop_table('author')
    # ### end Alembic commands ###
