support workflow_run_id in totp code (#2199)

This commit is contained in:
Shuchang Zheng
2025-04-21 08:24:29 +08:00
committed by GitHub
parent 8b9c7c17e3
commit 9038e6e047
6 changed files with 46 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
"""add workflow_run_id to totp code model
Revision ID: 511d9da18f5d
Revises: 3aa168d1ffa5
Create Date: 2025-04-21 00:19:48.989020+00:00
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision: str = "511d9da18f5d"
down_revision: Union[str, None] = "3aa168d1ffa5"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("totp_codes", sa.Column("workflow_run_id", sa.String(), nullable=True))
op.create_foreign_key(None, "totp_codes", "workflow_runs", ["workflow_run_id"], ["workflow_run_id"])
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, "totp_codes", type_="foreignkey")
op.drop_column("totp_codes", "workflow_run_id")
# ### end Alembic commands ###