"""Make artifact scanned_at, updated_at columns timezone aware

Revision ID: 982a7c19a06c
Revises: 5b171528a6f5
Create Date: 2025-09-04 03:23:38.648535

"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "982a7c19a06c"
down_revision = "5b171528a6f5"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "artifacts",
        "scanned_at",
        existing_type=postgresql.TIMESTAMP(),
        type_=sa.DateTime(timezone=True),
        existing_nullable=False,
        existing_server_default="now()",
    )
    op.alter_column(
        "artifacts",
        "updated_at",
        existing_type=postgresql.TIMESTAMP(),
        type_=sa.DateTime(timezone=True),
        existing_nullable=False,
        existing_server_default="now()",
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "artifacts",
        "updated_at",
        existing_type=sa.DateTime(timezone=False),
        type_=postgresql.TIMESTAMP(),
        existing_nullable=False,
        existing_server_default="now()",
    )
    op.alter_column(
        "artifacts",
        "scanned_at",
        existing_type=sa.DateTime(timezone=False),
        type_=postgresql.TIMESTAMP(),
        existing_nullable=False,
        existing_server_default="now()",
    )
    # ### end Alembic commands ###
