31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
"""added relationship allocation-classe
|
|
|
|
Revision ID: 42a297861f20
|
|
Revises: 19d939dbc6d0
|
|
Create Date: 2023-01-26 14:23:42.771763
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '42a297861f20'
|
|
down_revision = '19d939dbc6d0'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.add_column('allocation', sa.Column('classe_id', sa.Unicode(length=45), nullable=True))
|
|
op.create_foreign_key(op.f('fk_allocation_classe_id_classes'), 'allocation', 'classes', ['classe_id'], ['classe'])
|
|
op.drop_column('allocation', 'classe')
|
|
# ### end Alembic commands ###
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.add_column('allocation', sa.Column('classe', sa.VARCHAR(length=45), nullable=False))
|
|
op.drop_constraint(op.f('fk_allocation_classe_id_classes'), 'allocation', type_='foreignkey')
|
|
op.drop_column('allocation', 'classe_id')
|
|
# ### end Alembic commands ###
|