"""students table

Revision ID: 2f5524360975
Revises: 2ab54698c946
Create Date: 2019-02-26 11:31:30.457000

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '2f5524360975'
down_revision = '2ab54698c946'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('students',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=True),
    sa.Column('mobile', sa.String(), nullable=True),
    sa.Column('email', sa.String(), nullable=True),
    sa.Column('notes', sa.String(), nullable=True),
    sa.Column('father', sa.String(), nullable=True),
    sa.Column('mother', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('parentStudent',
    sa.Column('parent_id', sa.Integer(), nullable=False),
    sa.Column('student_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['parent_id'], ['parents.id'], ),
    sa.ForeignKeyConstraint(['student_id'], ['students.id'], ),
    sa.PrimaryKeyConstraint('parent_id', 'student_id')
    )
    # ### end Alembic commands ###


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