<filename>migrations/versions/78271d3a99c1_all_tables_modified.py
"""All tables modified

Revision ID: 78271d3a99c1
Revises: 
Create Date: 2019-10-30 02:02:24.453632

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '78271d3a99c1'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('patientplaceofmedicalservicechoice',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=True),
    sa.Column('extra', sa.String(length=50), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=64), nullable=True),
    sa.Column('email', sa.String(length=120), nullable=True),
    sa.Column('password_hash', sa.String(length=128), nullable=True),
    sa.Column('about_me', sa.String(length=140), nullable=True),
    sa.Column('last_seen', sa.DateTime(), nullable=True),
    sa.Column('last_message_read_time', sa.DateTime(), nullable=True),
    sa.Column('picture', sa.String(length=128), nullable=True),
    sa.Column('color', sa.String(length=128), nullable=True),
    sa.Column('sex', sa.String(length=64), nullable=True),
    sa.Column('age', sa.Float(), nullable=True),
    sa.Column('dob', sa.DateTime(), nullable=True),
    sa.Column('pob', sa.String(length=140), nullable=True),
    sa.Column('weight', sa.Float(), nullable=True),
    sa.Column('height', sa.Float(), nullable=True),
    sa.Column('village', sa.String(length=140), nullable=True),
    sa.Column('parish', sa.String(length=140), nullable=True),
    sa.Column('subcounty', sa.String(length=140), nullable=True),
    sa.Column('lon', sa.String(length=64), nullable=True),
    sa.Column('lat', sa.String(length=64), nullable=True),
    sa.Column('dateofonset', sa.DateTime(), nullable=True),
    sa.Column('ageofonset', sa.Integer(), nullable=True),
    sa.Column('where', sa.String(length=140), nullable=True),
    sa.Column('veryfirstsignssymptoms', sa.String(length=140), nullable=True),
    sa.Column('guardian_father', sa.String(length=140), nullable=True),
    sa.Column('guardian_mother', sa.String(length=140), nullable=True),
    sa.Column('guardian_other', sa.String(length=140), nullable=True),
    sa.Column('telephone1', sa.Integer(), nullable=True),
    sa.Column('telephone2', sa.Integer(), nullable=True),
    sa.Column('nameofidpcamp', sa.String(length=140), nullable=True),
    sa.Column('yearsspentinidpcamp', sa.DateTime(), nullable=True),
    sa.Column('watersourceduringonset', sa.String(length=140), nullable=True),
    sa.Column('numberofsiblings', sa.Integer(), nullable=True),
    sa.Column('numberofsiblingswithnodding', sa.Integer(), nullable=True),
    sa.Column('numberofsiblingsalive', sa.Integer(), nullable=True),
    sa.Column('numberofsiblingswithepilepsy', sa.Integer(), nullable=True),
    sa.Column('noddingrelateddeathsinfam', sa.Integer(), nullable=True),
    sa.Column('patientplaceofmedicalservice', sa.String(length=140), nullable=True),
    sa.Column('typeofnearesthealthcenter', sa.String(length=140), nullable=True),
    sa.Column('address', sa.String(length=10), nullable=True),
    sa.Column('famsize', sa.String(length=10), nullable=True),
    sa.Column('pstatus', sa.String(length=10), nullable=True),
    sa.Column('medu', sa.String(length=140), nullable=True),
    sa.Column('fedu', sa.String(length=140), nullable=True),
    sa.Column('mhealth', sa.String(length=140), nullable=True),
    sa.Column('fhealth', sa.String(length=140), nullable=True),
    sa.Column('mjob', sa.String(length=140), nullable=True),
    sa.Column('fjob', sa.String(length=140), nullable=True),
    sa.Column('reason', sa.String(length=140), nullable=True),
    sa.Column('guardian', sa.String(length=140), nullable=True),
    sa.Column('traveltime', sa.String(length=140), nullable=True),
    sa.Column('nursevisittime', sa.String(length=140), nullable=True),
    sa.Column('mealsdaily', sa.String(length=140), nullable=True),
    sa.Column('malnutritiontreatment', sa.String(length=10), nullable=True),
    sa.Column('siblingswithrelatedsickness', sa.String(length=10), nullable=True),
    sa.Column('seizurespermonth', sa.String(length=140), nullable=True),
    sa.Column('durationofseizure', sa.String(length=140), nullable=True),
    sa.Column('activitylevel', sa.String(length=10), nullable=True),
    sa.Column('behavioralproblems', sa.String(length=140), nullable=True),
    sa.Column('triggers', sa.String(length=140), nullable=True),
    sa.Column('screeningfailed', sa.String(length=10), nullable=True),
    sa.Column('extranutritionalsupport', sa.String(length=10), nullable=True),
    sa.Column('famed', sa.String(length=10), nullable=True),
    sa.Column('extrapaidsupport', sa.String(length=10), nullable=True),
    sa.Column('famrelation', sa.String(length=10), nullable=True),
    sa.Column('playout', sa.String(length=10), nullable=True),
    sa.Column('seizurestatus', sa.String(length=10), nullable=True),
    sa.Column('drugadministration', sa.String(length=10), nullable=True),
    sa.Column('schoolenrolment', sa.String(length=10), nullable=True),
    sa.Column('aidatasetnotes', sa.String(length=140), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_user_activitylevel'), 'user', ['activitylevel'], unique=False)
    op.create_index(op.f('ix_user_address'), 'user', ['address'], unique=False)
    op.create_index(op.f('ix_user_age'), 'user', ['age'], unique=False)
    op.create_index(op.f('ix_user_ageofonset'), 'user', ['ageofonset'], unique=False)
    op.create_index(op.f('ix_user_behavioralproblems'), 'user', ['behavioralproblems'], unique=False)
    op.create_index(op.f('ix_user_dateofonset'), 'user', ['dateofonset'], unique=False)
    op.create_index(op.f('ix_user_dob'), 'user', ['dob'], unique=False)
    op.create_index(op.f('ix_user_drugadministration'), 'user', ['drugadministration'], unique=False)
    op.create_index(op.f('ix_user_durationofseizure'), 'user', ['durationofseizure'], unique=False)
    op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
    op.create_index(op.f('ix_user_extranutritionalsupport'), 'user', ['extranutritionalsupport'], unique=False)
    op.create_index(op.f('ix_user_extrapaidsupport'), 'user', ['extrapaidsupport'], unique=False)
    op.create_index(op.f('ix_user_famed'), 'user', ['famed'], unique=False)
    op.create_index(op.f('ix_user_famrelation'), 'user', ['famrelation'], unique=False)
    op.create_index(op.f('ix_user_famsize'), 'user', ['famsize'], unique=False)
    op.create_index(op.f('ix_user_fedu'), 'user', ['fedu'], unique=False)
    op.create_index(op.f('ix_user_fhealth'), 'user', ['fhealth'], unique=False)
    op.create_index(op.f('ix_user_fjob'), 'user', ['fjob'], unique=False)
    op.create_index(op.f('ix_user_guardian'), 'user', ['guardian'], unique=False)
    op.create_index(op.f('ix_user_height'), 'user', ['height'], unique=False)
    op.create_index(op.f('ix_user_malnutritiontreatment'), 'user', ['malnutritiontreatment'], unique=False)
    op.create_index(op.f('ix_user_mealsdaily'), 'user', ['mealsdaily'], unique=False)
    op.create_index(op.f('ix_user_medu'), 'user', ['medu'], unique=False)
    op.create_index(op.f('ix_user_mhealth'), 'user', ['mhealth'], unique=False)
    op.create_index(op.f('ix_user_mjob'), 'user', ['mjob'], unique=False)
    op.create_index(op.f('ix_user_nameofidpcamp'), 'user', ['nameofidpcamp'], unique=False)
    op.create_index(op.f('ix_user_noddingrelateddeathsinfam'), 'user', ['noddingrelateddeathsinfam'], unique=False)
    op.create_index(op.f('ix_user_numberofsiblings'), 'user', ['numberofsiblings'], unique=False)
    op.create_index(op.f('ix_user_numberofsiblingsalive'), 'user', ['numberofsiblingsalive'], unique=False)
    op.create_index(op.f('ix_user_numberofsiblingswithepilepsy'), 'user', ['numberofsiblingswithepilepsy'], unique=False)
    op.create_index(op.f('ix_user_numberofsiblingswithnodding'), 'user', ['numberofsiblingswithnodding'], unique=False)
    op.create_index(op.f('ix_user_nursevisittime'), 'user', ['nursevisittime'], unique=False)
    op.create_index(op.f('ix_user_parish'), 'user', ['parish'], unique=False)
    op.create_index(op.f('ix_user_patientplaceofmedicalservice'), 'user', ['patientplaceofmedicalservice'], unique=False)
    op.create_index(op.f('ix_user_playout'), 'user', ['playout'], unique=False)
    op.create_index(op.f('ix_user_pob'), 'user', ['pob'], unique=False)
    op.create_index(op.f('ix_user_pstatus'), 'user', ['pstatus'], unique=False)
    op.create_index(op.f('ix_user_reason'), 'user', ['reason'], unique=False)
    op.create_index(op.f('ix_user_schoolenrolment'), 'user', ['schoolenrolment'], unique=False)
    op.create_index(op.f('ix_user_screeningfailed'), 'user', ['screeningfailed'], unique=False)
    op.create_index(op.f('ix_user_seizurespermonth'), 'user', ['seizurespermonth'], unique=False)
    op.create_index(op.f('ix_user_seizurestatus'), 'user', ['seizurestatus'], unique=False)
    op.create_index(op.f('ix_user_sex'), 'user', ['sex'], unique=False)
    op.create_index(op.f('ix_user_siblingswithrelatedsickness'), 'user', ['siblingswithrelatedsickness'], unique=False)
    op.create_index(op.f('ix_user_subcounty'), 'user', ['subcounty'], unique=False)
    op.create_index(op.f('ix_user_traveltime'), 'user', ['traveltime'], unique=False)
    op.create_index(op.f('ix_user_triggers'), 'user', ['triggers'], unique=False)
    op.create_index(op.f('ix_user_typeofnearesthealthcenter'), 'user', ['typeofnearesthealthcenter'], unique=False)
    op.create_index(op.f('ix_user_username'), 'user', ['username'], unique=True)
    op.create_index(op.f('ix_user_veryfirstsignssymptoms'), 'user', ['veryfirstsignssymptoms'], unique=False)
    op.create_index(op.f('ix_user_village'), 'user', ['village'], unique=False)
    op.create_index(op.f('ix_user_watersourceduringonset'), 'user', ['watersourceduringonset'], unique=False)
    op.create_index(op.f('ix_user_weight'), 'user', ['weight'], unique=False)
    op.create_index(op.f('ix_user_where'), 'user', ['where'], unique=False)
    op.create_index(op.f('ix_user_yearsspentinidpcamp'), 'user', ['yearsspentinidpcamp'], unique=False)
    op.create_table('yesnochoice',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=True),
    sa.Column('extra', sa.String(length=50), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('followers',
    sa.Column('follower_id', sa.Integer(), nullable=True),
    sa.Column('followed_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['followed_id'], ['user.id'], ),
    sa.ForeignKeyConstraint(['follower_id'], ['user.id'], )
    )
    op.create_table('message',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('sender_id', sa.Integer(), nullable=True),
    sa.Column('recipient_id', sa.Integer(), nullable=True),
    sa.Column('body', sa.String(length=140), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['recipient_id'], ['user.id'], ),
    sa.ForeignKeyConstraint(['sender_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_message_timestamp'), 'message', ['timestamp'], unique=False)
    op.create_table('notification',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=128), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('timestamp', sa.Float(), nullable=True),
    sa.Column('payload_json', sa.Text(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_notification_name'), 'notification', ['name'], unique=False)
    op.create_index(op.f('ix_notification_timestamp'), 'notification', ['timestamp'], unique=False)
    op.create_table('post',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('body', sa.String(length=140), nullable=True),
    sa.Column('height', sa.Float(), nullable=True),
    sa.Column('weight', sa.Float(), nullable=True),
    sa.Column('bmi', sa.Float(), nullable=True),
    sa.Column('muac', sa.Float(), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('language', sa.String(length=5), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_post_timestamp'), 'post', ['timestamp'], unique=False)
    op.create_table('task',
    sa.Column('id', sa.String(length=36), nullable=False),
    sa.Column('name', sa.String(length=128), nullable=True),
    sa.Column('description', sa.String(length=128), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('complete', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_task_name'), 'task', ['name'], unique=False)
    op.create_table('waypoint',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('place', sa.String(length=140), nullable=True),
    sa.Column('placelon', sa.String(length=64), nullable=True),
    sa.Column('placelat', sa.String(length=64), nullable=True),
    sa.Column('tolon', sa.String(length=64), nullable=True),
    sa.Column('tolat', sa.String(length=64), nullable=True),
    sa.Column('description', sa.String(length=140), nullable=True),
    sa.Column('picture', sa.String(length=128), nullable=True),
    sa.Column('color', sa.String(length=128), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('language', sa.String(length=5), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_waypoint_timestamp'), 'waypoint', ['timestamp'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_waypoint_timestamp'), table_name='waypoint')
    op.drop_table('waypoint')
    op.drop_index(op.f('ix_task_name'), table_name='task')
    op.drop_table('task')
    op.drop_index(op.f('ix_post_timestamp'), table_name='post')
    op.drop_table('post')
    op.drop_index(op.f('ix_notification_timestamp'), table_name='notification')
    op.drop_index(op.f('ix_notification_name'), table_name='notification')
    op.drop_table('notification')
    op.drop_index(op.f('ix_message_timestamp'), table_name='message')
    op.drop_table('message')
    op.drop_table('followers')
    op.drop_table('yesnochoice')
    op.drop_index(op.f('ix_user_yearsspentinidpcamp'), table_name='user')
    op.drop_index(op.f('ix_user_where'), table_name='user')
    op.drop_index(op.f('ix_user_weight'), table_name='user')
    op.drop_index(op.f('ix_user_watersourceduringonset'), table_name='user')
    op.drop_index(op.f('ix_user_village'), table_name='user')
    op.drop_index(op.f('ix_user_veryfirstsignssymptoms'), table_name='user')
    op.drop_index(op.f('ix_user_username'), table_name='user')
    op.drop_index(op.f('ix_user_typeofnearesthealthcenter'), table_name='user')
    op.drop_index(op.f('ix_user_triggers'), table_name='user')
    op.drop_index(op.f('ix_user_traveltime'), table_name='user')
    op.drop_index(op.f('ix_user_subcounty'), table_name='user')
    op.drop_index(op.f('ix_user_siblingswithrelatedsickness'), table_name='user')
    op.drop_index(op.f('ix_user_sex'), table_name='user')
    op.drop_index(op.f('ix_user_seizurestatus'), table_name='user')
    op.drop_index(op.f('ix_user_seizurespermonth'), table_name='user')
    op.drop_index(op.f('ix_user_screeningfailed'), table_name='user')
    op.drop_index(op.f('ix_user_schoolenrolment'), table_name='user')
    op.drop_index(op.f('ix_user_reason'), table_name='user')
    op.drop_index(op.f('ix_user_pstatus'), table_name='user')
    op.drop_index(op.f('ix_user_pob'), table_name='user')
    op.drop_index(op.f('ix_user_playout'), table_name='user')
    op.drop_index(op.f('ix_user_patientplaceofmedicalservice'), table_name='user')
    op.drop_index(op.f('ix_user_parish'), table_name='user')
    op.drop_index(op.f('ix_user_nursevisittime'), table_name='user')
    op.drop_index(op.f('ix_user_numberofsiblingswithnodding'), table_name='user')
    op.drop_index(op.f('ix_user_numberofsiblingswithepilepsy'), table_name='user')
    op.drop_index(op.f('ix_user_numberofsiblingsalive'), table_name='user')
    op.drop_index(op.f('ix_user_numberofsiblings'), table_name='user')
    op.drop_index(op.f('ix_user_noddingrelateddeathsinfam'), table_name='user')
    op.drop_index(op.f('ix_user_nameofidpcamp'), table_name='user')
    op.drop_index(op.f('ix_user_mjob'), table_name='user')
    op.drop_index(op.f('ix_user_mhealth'), table_name='user')
    op.drop_index(op.f('ix_user_medu'), table_name='user')
    op.drop_index(op.f('ix_user_mealsdaily'), table_name='user')
    op.drop_index(op.f('ix_user_malnutritiontreatment'), table_name='user')
    op.drop_index(op.f('ix_user_height'), table_name='user')
    op.drop_index(op.f('ix_user_guardian'), table_name='user')
    op.drop_index(op.f('ix_user_fjob'), table_name='user')
    op.drop_index(op.f('ix_user_fhealth'), table_name='user')
    op.drop_index(op.f('ix_user_fedu'), table_name='user')
    op.drop_index(op.f('ix_user_famsize'), table_name='user')
    op.drop_index(op.f('ix_user_famrelation'), table_name='user')
    op.drop_index(op.f('ix_user_famed'), table_name='user')
    op.drop_index(op.f('ix_user_extrapaidsupport'), table_name='user')
    op.drop_index(op.f('ix_user_extranutritionalsupport'), table_name='user')
    op.drop_index(op.f('ix_user_email'), table_name='user')
    op.drop_index(op.f('ix_user_durationofseizure'), table_name='user')
    op.drop_index(op.f('ix_user_drugadministration'), table_name='user')
    op.drop_index(op.f('ix_user_dob'), table_name='user')
    op.drop_index(op.f('ix_user_dateofonset'), table_name='user')
    op.drop_index(op.f('ix_user_behavioralproblems'), table_name='user')
    op.drop_index(op.f('ix_user_ageofonset'), table_name='user')
    op.drop_index(op.f('ix_user_age'), table_name='user')
    op.drop_index(op.f('ix_user_address'), table_name='user')
    op.drop_index(op.f('ix_user_activitylevel'), table_name='user')
    op.drop_table('user')
    op.drop_table('patientplaceofmedicalservicechoice')
    # ### end Alembic commands ###

<filename>migrations/versions/78271d3a99c1_all_tables_modified.py
"""All tables modified

Revision ID: 78271d3a99c1
Revises: 
Create Date: 2019-10-30 02:02:24.453632

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '78271d3a99c1'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('patientplaceofmedicalservicechoice',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=True),
    sa.Column('extra', sa.String(length=50), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=64), nullable=True),
    sa.Column('email', sa.String(length=120), nullable=True),
    sa.Column('password_hash', sa.String(length=128), nullable=True),
    sa.Column('about_me', sa.String(length=140), nullable=True),
    sa.Column('last_seen', sa.DateTime(), nullable=True),
    sa.Column('last_message_read_time', sa.DateTime(), nullable=True),
    sa.Column('picture', sa.String(length=128), nullable=True),
    sa.Column('color', sa.String(length=128), nullable=True),
    sa.Column('sex', sa.String(length=64), nullable=True),
    sa.Column('age', sa.Float(), nullable=True),
    sa.Column('dob', sa.DateTime(), nullable=True),
    sa.Column('pob', sa.String(length=140), nullable=True),
    sa.Column('weight', sa.Float(), nullable=True),
    sa.Column('height', sa.Float(), nullable=True),
    sa.Column('village', sa.String(length=140), nullable=True),
    sa.Column('parish', sa.String(length=140), nullable=True),
    sa.Column('subcounty', sa.String(length=140), nullable=True),
    sa.Column('lon', sa.String(length=64), nullable=True),
    sa.Column('lat', sa.String(length=64), nullable=True),
    sa.Column('dateofonset', sa.DateTime(), nullable=True),
    sa.Column('ageofonset', sa.Integer(), nullable=True),
    sa.Column('where', sa.String(length=140), nullable=True),
    sa.Column('veryfirstsignssymptoms', sa.String(length=140), nullable=True),
    sa.Column('guardian_father', sa.String(length=140), nullable=True),
    sa.Column('guardian_mother', sa.String(length=140), nullable=True),
    sa.Column('guardian_other', sa.String(length=140), nullable=True),
    sa.Column('telephone1', sa.Integer(), nullable=True),
    sa.Column('telephone2', sa.Integer(), nullable=True),
    sa.Column('nameofidpcamp', sa.String(length=140), nullable=True),
    sa.Column('yearsspentinidpcamp', sa.DateTime(), nullable=True),
    sa.Column('watersourceduringonset', sa.String(length=140), nullable=True),
    sa.Column('numberofsiblings', sa.Integer(), nullable=True),
    sa.Column('numberofsiblingswithnodding', sa.Integer(), nullable=True),
    sa.Column('numberofsiblingsalive', sa.Integer(), nullable=True),
    sa.Column('numberofsiblingswithepilepsy', sa.Integer(), nullable=True),
    sa.Column('noddingrelateddeathsinfam', sa.Integer(), nullable=True),
    sa.Column('patientplaceofmedicalservice', sa.String(length=140), nullable=True),
    sa.Column('typeofnearesthealthcenter', sa.String(length=140), nullable=True),
    sa.Column('address', sa.String(length=10), nullable=True),
    sa.Column('famsize', sa.String(length=10), nullable=True),
    sa.Column('pstatus', sa.String(length=10), nullable=True),
    sa.Column('medu', sa.String(length=140), nullable=True),
    sa.Column('fedu', sa.String(length=140), nullable=True),
    sa.Column('mhealth', sa.String(length=140), nullable=True),
    sa.Column('fhealth', sa.String(length=140), nullable=True),
    sa.Column('mjob', sa.String(length=140), nullable=True),
    sa.Column('fjob', sa.String(length=140), nullable=True),
    sa.Column('reason', sa.String(length=140), nullable=True),
    sa.Column('guardian', sa.String(length=140), nullable=True),
    sa.Column('traveltime', sa.String(length=140), nullable=True),
    sa.Column('nursevisittime', sa.String(length=140), nullable=True),
    sa.Column('mealsdaily', sa.String(length=140), nullable=True),
    sa.Column('malnutritiontreatment', sa.String(length=10), nullable=True),
    sa.Column('siblingswithrelatedsickness', sa.String(length=10), nullable=True),
    sa.Column('seizurespermonth', sa.String(length=140), nullable=True),
    sa.Column('durationofseizure', sa.String(length=140), nullable=True),
    sa.Column('activitylevel', sa.String(length=10), nullable=True),
    sa.Column('behavioralproblems', sa.String(length=140), nullable=True),
    sa.Column('triggers', sa.String(length=140), nullable=True),
    sa.Column('screeningfailed', sa.String(length=10), nullable=True),
    sa.Column('extranutritionalsupport', sa.String(length=10), nullable=True),
    sa.Column('famed', sa.String(length=10), nullable=True),
    sa.Column('extrapaidsupport', sa.String(length=10), nullable=True),
    sa.Column('famrelation', sa.String(length=10), nullable=True),
    sa.Column('playout', sa.String(length=10), nullable=True),
    sa.Column('seizurestatus', sa.String(length=10), nullable=True),
    sa.Column('drugadministration', sa.String(length=10), nullable=True),
    sa.Column('schoolenrolment', sa.String(length=10), nullable=True),
    sa.Column('aidatasetnotes', sa.String(length=140), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_user_activitylevel'), 'user', ['activitylevel'], unique=False)
    op.create_index(op.f('ix_user_address'), 'user', ['address'], unique=False)
    op.create_index(op.f('ix_user_age'), 'user', ['age'], unique=False)
    op.create_index(op.f('ix_user_ageofonset'), 'user', ['ageofonset'], unique=False)
    op.create_index(op.f('ix_user_behavioralproblems'), 'user', ['behavioralproblems'], unique=False)
    op.create_index(op.f('ix_user_dateofonset'), 'user', ['dateofonset'], unique=False)
    op.create_index(op.f('ix_user_dob'), 'user', ['dob'], unique=False)
    op.create_index(op.f('ix_user_drugadministration'), 'user', ['drugadministration'], unique=False)
    op.create_index(op.f('ix_user_durationofseizure'), 'user', ['durationofseizure'], unique=False)
    op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
    op.create_index(op.f('ix_user_extranutritionalsupport'), 'user', ['extranutritionalsupport'], unique=False)
    op.create_index(op.f('ix_user_extrapaidsupport'), 'user', ['extrapaidsupport'], unique=False)
    op.create_index(op.f('ix_user_famed'), 'user', ['famed'], unique=False)
    op.create_index(op.f('ix_user_famrelation'), 'user', ['famrelation'], unique=False)
    op.create_index(op.f('ix_user_famsize'), 'user', ['famsize'], unique=False)
    op.create_index(op.f('ix_user_fedu'), 'user', ['fedu'], unique=False)
    op.create_index(op.f('ix_user_fhealth'), 'user', ['fhealth'], unique=False)
    op.create_index(op.f('ix_user_fjob'), 'user', ['fjob'], unique=False)
    op.create_index(op.f('ix_user_guardian'), 'user', ['guardian'], unique=False)
    op.create_index(op.f('ix_user_height'), 'user', ['height'], unique=False)
    op.create_index(op.f('ix_user_malnutritiontreatment'), 'user', ['malnutritiontreatment'], unique=False)
    op.create_index(op.f('ix_user_mealsdaily'), 'user', ['mealsdaily'], unique=False)
    op.create_index(op.f('ix_user_medu'), 'user', ['medu'], unique=False)
    op.create_index(op.f('ix_user_mhealth'), 'user', ['mhealth'], unique=False)
    op.create_index(op.f('ix_user_mjob'), 'user', ['mjob'], unique=False)
    op.create_index(op.f('ix_user_nameofidpcamp'), 'user', ['nameofidpcamp'], unique=False)
    op.create_index(op.f('ix_user_noddingrelateddeathsinfam'), 'user', ['noddingrelateddeathsinfam'], unique=False)
    op.create_index(op.f('ix_user_numberofsiblings'), 'user', ['numberofsiblings'], unique=False)
    op.create_index(op.f('ix_user_numberofsiblingsalive'), 'user', ['numberofsiblingsalive'], unique=False)
    op.create_index(op.f('ix_user_numberofsiblingswithepilepsy'), 'user', ['numberofsiblingswithepilepsy'], unique=False)
    op.create_index(op.f('ix_user_numberofsiblingswithnodding'), 'user', ['numberofsiblingswithnodding'], unique=False)
    op.create_index(op.f('ix_user_nursevisittime'), 'user', ['nursevisittime'], unique=False)
    op.create_index(op.f('ix_user_parish'), 'user', ['parish'], unique=False)
    op.create_index(op.f('ix_user_patientplaceofmedicalservice'), 'user', ['patientplaceofmedicalservice'], unique=False)
    op.create_index(op.f('ix_user_playout'), 'user', ['playout'], unique=False)
    op.create_index(op.f('ix_user_pob'), 'user', ['pob'], unique=False)
    op.create_index(op.f('ix_user_pstatus'), 'user', ['pstatus'], unique=False)
    op.create_index(op.f('ix_user_reason'), 'user', ['reason'], unique=False)
    op.create_index(op.f('ix_user_schoolenrolment'), 'user', ['schoolenrolment'], unique=False)
    op.create_index(op.f('ix_user_screeningfailed'), 'user', ['screeningfailed'], unique=False)
    op.create_index(op.f('ix_user_seizurespermonth'), 'user', ['seizurespermonth'], unique=False)
    op.create_index(op.f('ix_user_seizurestatus'), 'user', ['seizurestatus'], unique=False)
    op.create_index(op.f('ix_user_sex'), 'user', ['sex'], unique=False)
    op.create_index(op.f('ix_user_siblingswithrelatedsickness'), 'user', ['siblingswithrelatedsickness'], unique=False)
    op.create_index(op.f('ix_user_subcounty'), 'user', ['subcounty'], unique=False)
    op.create_index(op.f('ix_user_traveltime'), 'user', ['traveltime'], unique=False)
    op.create_index(op.f('ix_user_triggers'), 'user', ['triggers'], unique=False)
    op.create_index(op.f('ix_user_typeofnearesthealthcenter'), 'user', ['typeofnearesthealthcenter'], unique=False)
    op.create_index(op.f('ix_user_username'), 'user', ['username'], unique=True)
    op.create_index(op.f('ix_user_veryfirstsignssymptoms'), 'user', ['veryfirstsignssymptoms'], unique=False)
    op.create_index(op.f('ix_user_village'), 'user', ['village'], unique=False)
    op.create_index(op.f('ix_user_watersourceduringonset'), 'user', ['watersourceduringonset'], unique=False)
    op.create_index(op.f('ix_user_weight'), 'user', ['weight'], unique=False)
    op.create_index(op.f('ix_user_where'), 'user', ['where'], unique=False)
    op.create_index(op.f('ix_user_yearsspentinidpcamp'), 'user', ['yearsspentinidpcamp'], unique=False)
    op.create_table('yesnochoice',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=True),
    sa.Column('extra', sa.String(length=50), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('followers',
    sa.Column('follower_id', sa.Integer(), nullable=True),
    sa.Column('followed_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['followed_id'], ['user.id'], ),
    sa.ForeignKeyConstraint(['follower_id'], ['user.id'], )
    )
    op.create_table('message',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('sender_id', sa.Integer(), nullable=True),
    sa.Column('recipient_id', sa.Integer(), nullable=True),
    sa.Column('body', sa.String(length=140), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['recipient_id'], ['user.id'], ),
    sa.ForeignKeyConstraint(['sender_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_message_timestamp'), 'message', ['timestamp'], unique=False)
    op.create_table('notification',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=128), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('timestamp', sa.Float(), nullable=True),
    sa.Column('payload_json', sa.Text(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_notification_name'), 'notification', ['name'], unique=False)
    op.create_index(op.f('ix_notification_timestamp'), 'notification', ['timestamp'], unique=False)
    op.create_table('post',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('body', sa.String(length=140), nullable=True),
    sa.Column('height', sa.Float(), nullable=True),
    sa.Column('weight', sa.Float(), nullable=True),
    sa.Column('bmi', sa.Float(), nullable=True),
    sa.Column('muac', sa.Float(), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('language', sa.String(length=5), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_post_timestamp'), 'post', ['timestamp'], unique=False)
    op.create_table('task',
    sa.Column('id', sa.String(length=36), nullable=False),
    sa.Column('name', sa.String(length=128), nullable=True),
    sa.Column('description', sa.String(length=128), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('complete', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_task_name'), 'task', ['name'], unique=False)
    op.create_table('waypoint',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('place', sa.String(length=140), nullable=True),
    sa.Column('placelon', sa.String(length=64), nullable=True),
    sa.Column('placelat', sa.String(length=64), nullable=True),
    sa.Column('tolon', sa.String(length=64), nullable=True),
    sa.Column('tolat', sa.String(length=64), nullable=True),
    sa.Column('description', sa.String(length=140), nullable=True),
    sa.Column('picture', sa.String(length=128), nullable=True),
    sa.Column('color', sa.String(length=128), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('language', sa.String(length=5), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_waypoint_timestamp'), 'waypoint', ['timestamp'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_waypoint_timestamp'), table_name='waypoint')
    op.drop_table('waypoint')
    op.drop_index(op.f('ix_task_name'), table_name='task')
    op.drop_table('task')
    op.drop_index(op.f('ix_post_timestamp'), table_name='post')
    op.drop_table('post')
    op.drop_index(op.f('ix_notification_timestamp'), table_name='notification')
    op.drop_index(op.f('ix_notification_name'), table_name='notification')
    op.drop_table('notification')
    op.drop_index(op.f('ix_message_timestamp'), table_name='message')
    op.drop_table('message')
    op.drop_table('followers')
    op.drop_table('yesnochoice')
    op.drop_index(op.f('ix_user_yearsspentinidpcamp'), table_name='user')
    op.drop_index(op.f('ix_user_where'), table_name='user')
    op.drop_index(op.f('ix_user_weight'), table_name='user')
    op.drop_index(op.f('ix_user_watersourceduringonset'), table_name='user')
    op.drop_index(op.f('ix_user_village'), table_name='user')
    op.drop_index(op.f('ix_user_veryfirstsignssymptoms'), table_name='user')
    op.drop_index(op.f('ix_user_username'), table_name='user')
    op.drop_index(op.f('ix_user_typeofnearesthealthcenter'), table_name='user')
    op.drop_index(op.f('ix_user_triggers'), table_name='user')
    op.drop_index(op.f('ix_user_traveltime'), table_name='user')
    op.drop_index(op.f('ix_user_subcounty'), table_name='user')
    op.drop_index(op.f('ix_user_siblingswithrelatedsickness'), table_name='user')
    op.drop_index(op.f('ix_user_sex'), table_name='user')
    op.drop_index(op.f('ix_user_seizurestatus'), table_name='user')
    op.drop_index(op.f('ix_user_seizurespermonth'), table_name='user')
    op.drop_index(op.f('ix_user_screeningfailed'), table_name='user')
    op.drop_index(op.f('ix_user_schoolenrolment'), table_name='user')
    op.drop_index(op.f('ix_user_reason'), table_name='user')
    op.drop_index(op.f('ix_user_pstatus'), table_name='user')
    op.drop_index(op.f('ix_user_pob'), table_name='user')
    op.drop_index(op.f('ix_user_playout'), table_name='user')
    op.drop_index(op.f('ix_user_patientplaceofmedicalservice'), table_name='user')
    op.drop_index(op.f('ix_user_parish'), table_name='user')
    op.drop_index(op.f('ix_user_nursevisittime'), table_name='user')
    op.drop_index(op.f('ix_user_numberofsiblingswithnodding'), table_name='user')
    op.drop_index(op.f('ix_user_numberofsiblingswithepilepsy'), table_name='user')
    op.drop_index(op.f('ix_user_numberofsiblingsalive'), table_name='user')
    op.drop_index(op.f('ix_user_numberofsiblings'), table_name='user')
    op.drop_index(op.f('ix_user_noddingrelateddeathsinfam'), table_name='user')
    op.drop_index(op.f('ix_user_nameofidpcamp'), table_name='user')
    op.drop_index(op.f('ix_user_mjob'), table_name='user')
    op.drop_index(op.f('ix_user_mhealth'), table_name='user')
    op.drop_index(op.f('ix_user_medu'), table_name='user')
    op.drop_index(op.f('ix_user_mealsdaily'), table_name='user')
    op.drop_index(op.f('ix_user_malnutritiontreatment'), table_name='user')
    op.drop_index(op.f('ix_user_height'), table_name='user')
    op.drop_index(op.f('ix_user_guardian'), table_name='user')
    op.drop_index(op.f('ix_user_fjob'), table_name='user')
    op.drop_index(op.f('ix_user_fhealth'), table_name='user')
    op.drop_index(op.f('ix_user_fedu'), table_name='user')
    op.drop_index(op.f('ix_user_famsize'), table_name='user')
    op.drop_index(op.f('ix_user_famrelation'), table_name='user')
    op.drop_index(op.f('ix_user_famed'), table_name='user')
    op.drop_index(op.f('ix_user_extrapaidsupport'), table_name='user')
    op.drop_index(op.f('ix_user_extranutritionalsupport'), table_name='user')
    op.drop_index(op.f('ix_user_email'), table_name='user')
    op.drop_index(op.f('ix_user_durationofseizure'), table_name='user')
    op.drop_index(op.f('ix_user_drugadministration'), table_name='user')
    op.drop_index(op.f('ix_user_dob'), table_name='user')
    op.drop_index(op.f('ix_user_dateofonset'), table_name='user')
    op.drop_index(op.f('ix_user_behavioralproblems'), table_name='user')
    op.drop_index(op.f('ix_user_ageofonset'), table_name='user')
    op.drop_index(op.f('ix_user_age'), table_name='user')
    op.drop_index(op.f('ix_user_address'), table_name='user')
    op.drop_index(op.f('ix_user_activitylevel'), table_name='user')
    op.drop_table('user')
    op.drop_table('patientplaceofmedicalservicechoice')
    # ### end Alembic commands ###

All tables modified  Revision ID: 78271d3a99c1 Revises:  Create Date: 2019-10-30 02:02:24.453632 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###