Files
Hotel-Booking/Backend/alembic/versions/add_stripe_payment_method.py
Iliyan Angelov 6f85b8cf17 updates
2025-11-21 01:20:51 +02:00

19 lines
704 B
Python

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
revision = 'add_stripe_payment_method'
down_revision = '96c23dad405d'
branch_labels = None
depends_on = None
def upgrade() -> None:
bind = op.get_bind()
if bind.dialect.name == 'mysql':
op.execute("ALTER TABLE payments MODIFY COLUMN payment_method ENUM('cash', 'credit_card', 'debit_card', 'bank_transfer', 'e_wallet', 'stripe') NOT NULL")
else:
pass
def downgrade() -> None:
bind = op.get_bind()
if bind.dialect.name == 'mysql':
op.execute("ALTER TABLE payments MODIFY COLUMN payment_method ENUM('cash', 'credit_card', 'debit_card', 'bank_transfer', 'e_wallet') NOT NULL")