"""empty message

Revision ID: 85a78afc4786
Revises: 
Create Date: 2021-06-27 23:42:04.126979

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '85a78afc4786'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('feed_type',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('code', sa.String(length=3), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('daily_amount', sa.Integer(), nullable=True),
    sa.Column('clear_before_add', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('transport_type',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('volunteer_type',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('code', sa.String(length=3), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('presence',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('arrival', sa.DateTime(), nullable=True),
    sa.Column('departure', sa.DateTime(), nullable=True),
    sa.Column('transport_type_id', sa.Integer(), nullable=True),
    sa.Column('needToMeet', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['transport_type_id'], ['transport_type.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('volunteer',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('surname', sa.String(length=256), nullable=True),
    sa.Column('callsign', sa.String(length=256), nullable=True),
    sa.Column('phone', sa.String(length=256), nullable=True),
    sa.Column('email', sa.String(length=256), nullable=True),
    sa.Column('photo', sa.BLOB(), nullable=True),
    sa.Column('short_uuid', sa.String(length=256), nullable=True),
    sa.Column('volunteer_type_id', sa.Integer(), nullable=False),
    sa.Column('feed_type_id', sa.Integer(), nullable=False),
    sa.Column('ref_to_id', sa.Integer(), nullable=True),
    sa.Column('has_signed_approval', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['feed_type_id'], ['feed_type.id'], ),
    sa.ForeignKeyConstraint(['ref_to_id'], [u'volunteer.id'], ),
    sa.ForeignKeyConstraint(['volunteer_type_id'], ['volunteer_type.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('QR__codes',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('volunteer_id', sa.Integer(), nullable=False),
    sa.Column('code', sa.String(length=256), nullable=True),
    sa.Column('is_active', sa.Integer(), nullable=True),
    sa.Column('is_valid', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['volunteer_id'], ['volunteer.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('department',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('is_federal', sa.Integer(), nullable=True),
    sa.Column('lead_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['lead_id'], ['volunteer.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('feed_balance',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('volunteer_id', sa.Integer(), nullable=False),
    sa.Column('balance', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['volunteer_id'], ['volunteer.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('feed_transaction',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('volunteer_id', sa.Integer(), nullable=False),
    sa.Column('trhash', sa.String(length=256), nullable=True),
    sa.Column('amount', sa.Integer(), nullable=True),
    sa.Column('hwo', sa.String(length=256), nullable=True),
    sa.Column('dtime', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['volunteer_id'], ['volunteer.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('vol_pres_link',
    sa.Column('volunteer_id', sa.Integer(), nullable=True),
    sa.Column('presence_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['presence_id'], ['presence.id'], ),
    sa.ForeignKeyConstraint(['volunteer_id'], ['volunteer.id'], )
    )
    op.create_table('vol_dept_link',
    sa.Column('volunteer_id', sa.Integer(), nullable=True),
    sa.Column('department_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['department_id'], ['department.id'], ),
    sa.ForeignKeyConstraint(['volunteer_id'], ['volunteer.id'], )
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('vol_dept_link')
    op.drop_table('vol_pres_link')
    op.drop_table('feed_transaction')
    op.drop_table('feed_balance')
    op.drop_table('department')
    op.drop_table('QR__codes')
    op.drop_table('volunteer')
    op.drop_table('presence')
    op.drop_table('volunteer_type')
    op.drop_table('transport_type')
    op.drop_table('feed_type')
    # ### end Alembic commands ###
