from alembic import op
import sqlalchemy as sa
revision = 'bd309b0742c1'
down_revision = 'f1a2b3c4d5e6'
branch_labels = None
depends_on = None

def upgrade() -> None:
    op.add_column('bookings', sa.Column('original_price', sa.Numeric(10, 2), nullable=True))
    op.add_column('bookings', sa.Column('discount_amount', sa.Numeric(10, 2), nullable=True, server_default='0'))
    op.add_column('bookings', sa.Column('promotion_code', sa.String(50), nullable=True))
    op.create_index(op.f('ix_bookings_promotion_code'), 'bookings', ['promotion_code'], unique=False)

def downgrade() -> None:
    op.drop_index(op.f('ix_bookings_promotion_code'), table_name='bookings')
    op.drop_column('bookings', 'promotion_code')
    op.drop_column('bookings', 'discount_amount')
    op.drop_column('bookings', 'original_price')