From 7f57cce7ceb3cffc25e31a4028f0a7371e037fb5 Mon Sep 17 00:00:00 2001 From: Salon POS Date: Wed, 6 May 2026 16:32:31 -0400 Subject: [PATCH] 05/06 Updated migration --- .../d1a0a7696679_description_of_change.py | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 migrations/versions/d1a0a7696679_description_of_change.py diff --git a/migrations/versions/d1a0a7696679_description_of_change.py b/migrations/versions/d1a0a7696679_description_of_change.py new file mode 100644 index 0000000..664e7ed --- /dev/null +++ b/migrations/versions/d1a0a7696679_description_of_change.py @@ -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 ###