26 lines
762 B
Python
26 lines
762 B
Python
from typing import Sequence, Union
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision: str = "006_add_details_fetched_at"
|
|
down_revision: Union[str, None] = "005_add_car_seen_sold_timestamps"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column(
|
|
"MOBILEDE_cars",
|
|
sa.Column("details_fetched_at", sa.DateTime(timezone=True), nullable=True),
|
|
)
|
|
op.create_index(
|
|
"ix_MOBILEDE_cars_details_fetched_at",
|
|
"MOBILEDE_cars",
|
|
["details_fetched_at"],
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_index("ix_MOBILEDE_cars_details_fetched_at", table_name="MOBILEDE_cars")
|
|
op.drop_column("MOBILEDE_cars", "details_fetched_at") |