35 lines
969 B
Python
35 lines
969 B
Python
"""Add course code
|
|
|
|
Revision ID: 862905f5e34a
|
|
Revises: 093a66f0b581
|
|
Create Date: 2023-04-06 21:55:54.838647
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '862905f5e34a'
|
|
down_revision = '093a66f0b581'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('course', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('course_code', sa.String(length=32), nullable=True))
|
|
batch_op.create_index(batch_op.f('ix_course_course_code'), ['course_code'], unique=False)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('course', schema=None) as batch_op:
|
|
batch_op.drop_index(batch_op.f('ix_course_course_code'))
|
|
batch_op.drop_column('course_code')
|
|
|
|
# ### end Alembic commands ###
|