|
| 1 | +"""dm_rental_fix_table |
| 2 | +
|
| 3 | +Revision ID: d1a22199f353 |
| 4 | +Revises: b259a3b8c31d |
| 5 | +Create Date: 2025-05-28 18:02:42.798163 |
| 6 | +
|
| 7 | +""" |
| 8 | + |
| 9 | +import os |
| 10 | + |
| 11 | +import sqlalchemy as sa |
| 12 | +from alembic import op |
| 13 | + |
| 14 | + |
| 15 | +# revision identifiers, used by Alembic. |
| 16 | +revision = 'd1a22199f353' |
| 17 | +down_revision = 'b259a3b8c31d' |
| 18 | +branch_labels = None |
| 19 | +depends_on = None |
| 20 | + |
| 21 | + |
| 22 | +def upgrade(): |
| 23 | + op.drop_column("dm_rentals_events", "duration", schema="DM_RENTAL") |
| 24 | + op.drop_column("dm_rentals_events", "delay", schema="DM_RENTAL") |
| 25 | + op.drop_column("dm_rentals_events", "overdue_flag", schema="DM_RENTAL") |
| 26 | + op.drop_column("dm_rentals_events", "conversion_flag", schema="DM_RENTAL") |
| 27 | + op.drop_column("dm_rentals_events", "available_items", schema="DM_RENTAL") |
| 28 | + op.drop_column("dm_rentals_events", "total_items", schema="DM_RENTAL") |
| 29 | + op.drop_column("dm_rentals_events", "rental_count", schema="DM_RENTAL") |
| 30 | + op.drop_column("dm_rentals_events", "avg_downtime_hours", schema="DM_RENTAL") |
| 31 | + op.drop_column("dm_rentals_events", "avg_rent_hours", schema="DM_RENTAL") |
| 32 | + op.drop_column("dm_rentals_events", "strike_count", schema="DM_RENTAL") |
| 33 | + op.drop_column("dm_rentals_events", "activity_max_time", schema="DM_RENTAL") |
| 34 | + op.drop_column("dm_rentals_events", "activity_max", schema="DM_RENTAL") |
| 35 | + op.drop_column("dm_rentals_events", "type", schema="DM_RENTAL") |
| 36 | + |
| 37 | + |
| 38 | +def downgrade(): |
| 39 | + op.add_column("dm_rentals_events", sa.Column("duration", sa.Interval()), schema="DM_RENTAL") |
| 40 | + op.add_column("dm_rentals_events", sa.Column("delay", sa.Interval()), schema="DM_RENTAL") |
| 41 | + op.add_column("dm_rentals_events", sa.Column("overdue_flag", sa.Boolean()), schema="DM_RENTAL") |
| 42 | + op.add_column("dm_rentals_events", sa.Column("conversion_flag", sa.Boolean()), schema="DM_RENTAL") |
| 43 | + op.add_column("dm_rentals_events", sa.Column("available_items", sa.Integer()), schema="DM_RENTAL") |
| 44 | + op.add_column("dm_rentals_events", sa.Column("total_items", sa.Integer()), schema="DM_RENTAL") |
| 45 | + op.add_column("dm_rentals_events", sa.Column("rental_count", sa.Integer()), schema="DM_RENTAL") |
| 46 | + op.add_column("dm_rentals_events", sa.Column("avg_downtime_hours", sa.Interval()), schema="DM_RENTAL") |
| 47 | + op.add_column("dm_rentals_events", sa.Column("avg_rent_hours", sa.Interval()), schema="DM_RENTAL") |
| 48 | + op.add_column("dm_rentals_events", sa.Column("strike_count", sa.Integer()), schema="DM_RENTAL") |
| 49 | + op.add_column("dm_rentals_events", sa.Column("activity_max_time", sa.Integer()), schema="DM_RENTAL") |
| 50 | + op.add_column("dm_rentals_events", sa.Column("activity_max", sa.Integer()), schema="DM_RENTAL") |
| 51 | + op.add_column("dm_rentals_events", sa.Column("type", sa.String()), schema="DM_RENTAL") |
0 commit comments