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.
 
 
 

46 lines
1.4 KiB

"""Add new features
Revision ID: 1b403a365765
Revises: 455cbec206cf
Create Date: 2025-08-09 17:45:22.066241
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '1b403a365765'
down_revision = '455cbec206cf'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('PaymentBatch',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('Created', sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('Payments', schema=None) as batch_op:
batch_op.add_column(sa.Column('PaymentBatch_ID', sa.Integer(), nullable=False))
batch_op.alter_column('PI_Last_Check',
existing_type=postgresql.TIMESTAMP(),
nullable=True)
batch_op.create_foreign_key(None, 'PaymentBatch', ['PaymentBatch_ID'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('Payments', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='foreignkey')
batch_op.alter_column('PI_Last_Check',
existing_type=postgresql.TIMESTAMP(),
nullable=False)
batch_op.drop_column('PaymentBatch_ID')
op.drop_table('PaymentBatch')
# ### end Alembic commands ###