Skip to content

Commit

Permalink
refactor: remove unnecessary intermediate alembic revision
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-schmid committed Nov 13, 2024
1 parent 3aa6d25 commit 2b66f86
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 91 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""add control table
"""add control results table
Revision ID: 63f98bfe65eb
Revision ID: 45c7ea136fad
Revises: 7e5d82221765
Create Date: 2024-11-06 18:41:23.795080
Create Date: 2024-11-13 14:14:51.387901
"""

Expand All @@ -14,7 +14,7 @@


# revision identifiers, used by Alembic.
revision: str = "63f98bfe65eb"
revision: str = "45c7ea136fad"
down_revision: Union[str, None] = "7e5d82221765"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
Expand All @@ -23,7 +23,7 @@
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"workflow_controls",
"workflow_controls_results",
sa.Column(
"created_at",
sa.TIMESTAMP(),
Expand All @@ -38,7 +38,7 @@ def upgrade() -> None:
),
sa.Column("workflow_id", sa.TEXT(), nullable=False),
sa.Column("run_id", sa.TEXT(), nullable=False),
sa.Column("result", sa.BOOLEAN(), nullable=False),
sa.Column("result", sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(
["workflow_id"], ["workflows.workflow_id"], ondelete="CASCADE"
),
Expand All @@ -49,5 +49,5 @@ def upgrade() -> None:

def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table("workflow_controls")
op.drop_table("workflow_controls_results")
# ### end Alembic commands ###
81 changes: 0 additions & 81 deletions admyral/db/alembic/versions/48422348dba4_rename_control_table.py

This file was deleted.

6 changes: 3 additions & 3 deletions admyral/utils/time.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from datetime import datetime, timezone
from datetime import datetime, UTC


def utc_now() -> datetime:
return datetime.now(timezone.utc)
return datetime.now(UTC)


def utc_now_timestamp_seconds() -> int:
return int(datetime.now(timezone.utc).timestamp())
return int(datetime.now(UTC).timestamp())

0 comments on commit 2b66f86

Please sign in to comment.