05/06 Updated migration
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
"""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 ###
|
||||
Reference in New Issue
Block a user