"""data_base

Revision ID: 9399fa923daa
Revises: 
Create Date: 2019-08-25 14:05:00.641207

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '9399fa923daa'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('Import',
    sa.Column('import_id', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('import_id')
    )
    op.create_table('Citizen',
    sa.Column('citizen_id', sa.Integer(), nullable=False),
    sa.Column('import_id', sa.Integer(), nullable=False),
    sa.Column('town', sa.String(), nullable=True),
    sa.Column('street', sa.String(), nullable=True),
    sa.Column('building', sa.String(), nullable=True),
    sa.Column('apartment', sa.Integer(), nullable=True),
    sa.Column('name', sa.String(), nullable=True),
    sa.Column('birth_date', sa.String(), nullable=True),
    sa.Column('gender', sa.String(), nullable=True),
    sa.Column('relatives', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['import_id'], ['Import.import_id'], ),
    sa.PrimaryKeyConstraint('citizen_id', 'import_id')
    )
    # ### end Alembic commands ###


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