"""empty message

Revision ID: 75c5879e7d58
Revises: 3c1b2df96777
Create Date: 2020-04-21 16:18:30.566326

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '75c5879e7d58'
down_revision = '3c1b2df96777'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('ress_contact',
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('updated_at', sa.DateTime(), nullable=False),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('firstname', sa.String(length=30), nullable=False),
    sa.Column('lastname', sa.String(length=30), nullable=False),
    sa.Column('email', sa.String(length=30), nullable=False),
    sa.Column('phone_number', sa.String(length=10), nullable=False),
    sa.Column('comment', sa.Text(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('ress_availability',
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('updated_at', sa.DateTime(), nullable=False),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('date', sa.DateTime(), nullable=False),
    sa.Column('functional_unit', sa.String(length=25), nullable=True),
    sa.Column('bed', sa.JSON(), nullable=True),
    sa.Column('supply', sa.JSON(), nullable=True),
    sa.Column('human', sa.JSON(), nullable=True),
    sa.Column('contact_id', sa.Integer(), nullable=True),
    sa.Column('platform_id', sa.Integer(), nullable=False),
    sa.Column('organization_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['contact_id'], ['ress_contact.id'], ),
    sa.ForeignKeyConstraint(['organization_id'], ['orga_organization.id'], ),
    sa.ForeignKeyConstraint(['platform_id'], ['orga_platform.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


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