Files
MyPOS/migrations/versions/d1a0a7696679_description_of_change.py
T
2026-05-06 16:32:31 -04:00

39 lines
1.2 KiB
Python

"""Description of change
Revision ID: d1a0a7696679
Revises: 10ec0a5894e8
Create Date: 2026-05-06 15:59:36.956205
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd1a0a7696679'
down_revision = '10ec0a5894e8'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointments', schema=None) as batch_op:
batch_op.create_foreign_key('fk_appt_rebooked_transaction', 'transactions', ['rebooked_from_transaction_id'], ['id'], use_alter=True)
with op.batch_alter_table('transactions', schema=None) as batch_op:
batch_op.create_foreign_key('fk_transaction_appointment', 'appointments', ['appointment_id'], ['id'], use_alter=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('transactions', schema=None) as batch_op:
batch_op.drop_constraint('fk_transaction_appointment', type_='foreignkey')
with op.batch_alter_table('appointments', schema=None) as batch_op:
batch_op.drop_constraint('fk_appt_rebooked_transaction', type_='foreignkey')
# ### end Alembic commands ###