Skip to content

Commit

Permalink
test(alembic): add migration to test workflow
Browse files Browse the repository at this point in the history
This commit needs to be removed, before merging the workflow changes.

Signed-off-by: Siddhesh Mhadnak <[email protected]>
  • Loading branch information
sid-maddy committed Aug 11, 2024
1 parent 81b7009 commit bbe8117
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions alembic/versions/ca14e3688152_make_datetimes_timezone_aware.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
"""Make datetimes timezone-aware
Revision ID: ca14e3688152
Revises: 6991bcb18f89
Create Date: 2024-08-11 14:00:37.225870
"""

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

# revision identifiers, used by Alembic.
revision = "ca14e3688152"
down_revision = "6991bcb18f89"
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column(
"scans",
"queued_at",
existing_type=postgresql.TIMESTAMP(),
type_=sa.DateTime(timezone=True),
existing_nullable=True,
)
op.alter_column(
"scans",
"pending_at",
existing_type=postgresql.TIMESTAMP(),
type_=sa.DateTime(timezone=True),
existing_nullable=True,
)
op.alter_column(
"scans",
"finished_at",
existing_type=postgresql.TIMESTAMP(),
type_=sa.DateTime(timezone=True),
existing_nullable=True,
)
op.alter_column(
"scans",
"reported_at",
existing_type=postgresql.TIMESTAMP(),
type_=sa.DateTime(timezone=True),
existing_nullable=True,
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column(
"scans",
"reported_at",
existing_type=sa.DateTime(timezone=True),
type_=postgresql.TIMESTAMP(),
existing_nullable=True,
)
op.alter_column(
"scans",
"finished_at",
existing_type=sa.DateTime(timezone=True),
type_=postgresql.TIMESTAMP(),
existing_nullable=True,
)
op.alter_column(
"scans",
"pending_at",
existing_type=sa.DateTime(timezone=True),
type_=postgresql.TIMESTAMP(),
existing_nullable=True,
)
op.alter_column(
"scans",
"queued_at",
existing_type=sa.DateTime(timezone=True),
type_=postgresql.TIMESTAMP(),
existing_nullable=True,
)
# ### end Alembic commands ###

0 comments on commit bbe8117

Please sign in to comment.