Spaces:
Sleeping
Sleeping
File size: 1,439 Bytes
3cf589c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
"""questions table
Revision ID: 9c77048e7767
Revises: 4f3f4537bb29
Create Date: 2020-09-22 18:51:37.951537
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9c77048e7767'
down_revision = '4f3f4537bb29'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('questions',
sa.Column('q_id', sa.Integer(), nullable=False),
sa.Column('ques', sa.String(length=350), nullable=True),
sa.Column('a', sa.String(length=100), nullable=True),
sa.Column('b', sa.String(length=100), nullable=True),
sa.Column('c', sa.String(length=100), nullable=True),
sa.Column('d', sa.String(length=100), nullable=True),
sa.Column('ans', sa.String(length=1), nullable=True),
sa.Column('marks', sa.Integer(), nullable=True),
sa.PrimaryKeyConstraint('q_id'),
sa.UniqueConstraint('ques')
)
op.create_index(op.f('ix_questions_ans'), 'questions', ['ans'], unique=False)
op.create_index(op.f('ix_questions_marks'), 'questions', ['marks'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_questions_marks'), table_name='questions')
op.drop_index(op.f('ix_questions_ans'), table_name='questions')
op.drop_table('questions')
# ### end Alembic commands ###
|