"""tot table

Revision ID: c00e3d390f1b
Revises: <PASSWORD>
Create Date: 2018-11-20 19:18:36.126740

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'c00e3d390f1b'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('contest',
    sa.Column('contestid', sa.Integer(), nullable=False),
    sa.Column('contestbegin', sa.DateTime(), nullable=True),
    sa.Column('contestlen', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('contestid')
    )
    op.create_table('problem',
    sa.Column('problemid', sa.Integer(), nullable=False),
    sa.Column('problemms', sa.Integer(), nullable=True),
    sa.Column('problemkb', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('problemid')
    )
    op.create_table('commit',
    sa.Column('commitid', sa.Integer(), nullable=False),
    sa.Column('userid', sa.Integer(), nullable=True),
    sa.Column('problemid', sa.Integer(), nullable=True),
    sa.Column('committime', sa.DateTime(), nullable=True),
    sa.Column('commitans', sa.String(length=64), nullable=True),
    sa.Column('commitms', sa.Integer(), nullable=True),
    sa.Column('commitkb', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['problemid'], ['problem.problemid'], ),
    sa.ForeignKeyConstraint(['userid'], ['user.userid'], ),
    sa.PrimaryKeyConstraint('commitid')
    )
    op.create_index(op.f('ix_commit_committime'), 'commit', ['committime'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_commit_committime'), table_name='commit')
    op.drop_table('commit')
    op.drop_table('problem')
    op.drop_table('contest')
    # ### end Alembic commands ###

"""tot table

Revision ID: c00e3d390f1b
Revises: <PASSWORD>
Create Date: 2018-11-20 19:18:36.126740

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'c00e3d390f1b'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('contest',
    sa.Column('contestid', sa.Integer(), nullable=False),
    sa.Column('contestbegin', sa.DateTime(), nullable=True),
    sa.Column('contestlen', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('contestid')
    )
    op.create_table('problem',
    sa.Column('problemid', sa.Integer(), nullable=False),
    sa.Column('problemms', sa.Integer(), nullable=True),
    sa.Column('problemkb', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('problemid')
    )
    op.create_table('commit',
    sa.Column('commitid', sa.Integer(), nullable=False),
    sa.Column('userid', sa.Integer(), nullable=True),
    sa.Column('problemid', sa.Integer(), nullable=True),
    sa.Column('committime', sa.DateTime(), nullable=True),
    sa.Column('commitans', sa.String(length=64), nullable=True),
    sa.Column('commitms', sa.Integer(), nullable=True),
    sa.Column('commitkb', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['problemid'], ['problem.problemid'], ),
    sa.ForeignKeyConstraint(['userid'], ['user.userid'], ),
    sa.PrimaryKeyConstraint('commitid')
    )
    op.create_index(op.f('ix_commit_committime'), 'commit', ['committime'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_commit_committime'), table_name='commit')
    op.drop_table('commit')
    op.drop_table('problem')
    op.drop_table('contest')
    # ### end Alembic commands ###

tot table  Revision ID: c00e3d390f1b Revises: <PASSWORD> Create Date: 2018-11-20 19:18:36.126740 # 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 ###