"""empty message

Revision ID: 3d938d194250
Revises: 
Create Date: 2021-04-08 19:49:38.310136

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3d938d194250'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('pruebas',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('tipo', sa.String(length=50), nullable=False),
    sa.Column('descripcion', sa.String(length=150), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('roles',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('rolename', sa.String(length=50), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('rolename')
    )
    op.create_table('preguntas',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('enunciado', sa.String(length=100), nullable=False),
    sa.Column('prueba_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['prueba_id'], ['pruebas.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('password', sa.String(length=100), nullable=False),
    sa.Column('nombre', sa.String(length=100), nullable=True),
    sa.Column('apellido', sa.String(length=100), nullable=True),
    sa.Column('course', sa.String(length=100), nullable=True),
    sa.Column('email', sa.String(length=100), nullable=False),
    sa.Column('avatar', sa.String(length=100), nullable=True),
    sa.Column('createdate', sa.DateTime(), nullable=True),
    sa.Column('role_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['role_id'], ['roles.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('alternativas',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('correcta', sa.String(length=100), nullable=False),
    sa.Column('pregunta_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['pregunta_id'], ['preguntas.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('distraccion',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('incorrecta', sa.String(length=100), nullable=False),
    sa.Column('alternativa_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['alternativa_id'], ['alternativas.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('distraccion')
    op.drop_table('alternativas')
    op.drop_table('users')
    op.drop_table('preguntas')
    op.drop_table('roles')
    op.drop_table('pruebas')
    # ### end Alembic commands ###
