You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.5 KiB
42 lines
1.5 KiB
"""Add new features
|
|
|
|
Revision ID: 3252db86eaae
|
|
Revises: 906059746902
|
|
Create Date: 2025-08-14 15:02:47.519589
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '3252db86eaae'
|
|
down_revision = '906059746902'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('Payments', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('PaymentPlan_ID', sa.Integer(), nullable=True))
|
|
batch_op.create_foreign_key(None, 'PaymentPlans', ['PaymentPlan_ID'], ['id'])
|
|
|
|
with op.batch_alter_table('SinglePayments', schema=None) as batch_op:
|
|
batch_op.drop_constraint(batch_op.f('SinglePayments_PaymentPlan_ID_fkey'), type_='foreignkey')
|
|
batch_op.drop_column('PaymentPlan_ID')
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('SinglePayments', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('PaymentPlan_ID', sa.INTEGER(), autoincrement=False, nullable=True))
|
|
batch_op.create_foreign_key(batch_op.f('SinglePayments_PaymentPlan_ID_fkey'), 'PaymentPlans', ['PaymentPlan_ID'], ['id'])
|
|
|
|
with op.batch_alter_table('Payments', schema=None) as batch_op:
|
|
batch_op.drop_constraint(None, type_='foreignkey')
|
|
batch_op.drop_column('PaymentPlan_ID')
|
|
|
|
# ### end Alembic commands ###
|
|
|