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.
60 lines
2.4 KiB
60 lines
2.4 KiB
"""Add new Charge and Refund features
|
|
|
|
Revision ID: 1af0e892bd5d
|
|
Revises: 3252db86eaae
|
|
Create Date: 2025-08-21 14:19:38.943110
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '1af0e892bd5d'
|
|
down_revision = '3252db86eaae'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('PaymentPlans', schema=None) as batch_op:
|
|
batch_op.drop_column('Day')
|
|
|
|
with op.batch_alter_table('Payments', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('Stripe_Charge_ID', sa.String(), nullable=True))
|
|
batch_op.add_column(sa.Column('Refund', sa.Boolean(), nullable=True))
|
|
batch_op.add_column(sa.Column('Refund_JSON', sa.Text(), nullable=True))
|
|
batch_op.add_column(sa.Column('Stripe_Refund_ID', sa.String(), nullable=True))
|
|
batch_op.add_column(sa.Column('Stripe_Refund_Created', sa.DateTime(), nullable=True))
|
|
|
|
with op.batch_alter_table('SinglePayments', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('Stripe_Charge_ID', sa.String(), nullable=True))
|
|
batch_op.add_column(sa.Column('Refund', sa.Boolean(), nullable=True))
|
|
batch_op.add_column(sa.Column('Refund_JSON', sa.Text(), nullable=True))
|
|
batch_op.add_column(sa.Column('Stripe_Refund_ID', sa.String(), nullable=True))
|
|
batch_op.add_column(sa.Column('Stripe_Refund_Created', sa.DateTime(), nullable=True))
|
|
|
|
# ### 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.drop_column('Stripe_Refund_Created')
|
|
batch_op.drop_column('Stripe_Refund_ID')
|
|
batch_op.drop_column('Refund_JSON')
|
|
batch_op.drop_column('Refund')
|
|
batch_op.drop_column('Stripe_Charge_ID')
|
|
|
|
with op.batch_alter_table('Payments', schema=None) as batch_op:
|
|
batch_op.drop_column('Stripe_Refund_Created')
|
|
batch_op.drop_column('Stripe_Refund_ID')
|
|
batch_op.drop_column('Refund_JSON')
|
|
batch_op.drop_column('Refund')
|
|
batch_op.drop_column('Stripe_Charge_ID')
|
|
|
|
with op.batch_alter_table('PaymentPlans', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('Day', sa.VARCHAR(length=50), autoincrement=False, nullable=True))
|
|
|
|
# ### end Alembic commands ###
|
|
|