Coverage for /usr/local/lib/python3.12/site-packages/prefect/server/database/_migrations/versions/sqlite/2023_09_06_084729_c2d001b7dd06_.py: 75%
16 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 11:21 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 11:21 +0000
1"""Adds heartbeat_interval_seconds column to worker table
3Revision ID: c2d001b7dd06
4Revises: 5b0bd3b41a23
5Create Date: 2023-09-06 08:47:29.381718
7"""
9import sqlalchemy as sa 1a
10from alembic import op 1a
12# revision identifiers, used by Alembic.
13revision = "c2d001b7dd06" 1a
14down_revision = "5b0bd3b41a23" 1a
15branch_labels = None 1a
16depends_on = None 1a
19def upgrade(): 1a
20 op.execute("PRAGMA foreign_keys=OFF") 1a
22 with op.batch_alter_table("worker", schema=None) as batch_op: 1a
23 batch_op.add_column( 1a
24 sa.Column("heartbeat_interval_seconds", sa.Integer(), nullable=True)
25 )
27 op.execute("PRAGMA foreign_keys=ON") 1a
30def downgrade(): 1a
31 op.execute("PRAGMA foreign_keys=OFF")
33 with op.batch_alter_table("worker", schema=None) as batch_op:
34 batch_op.drop_column("heartbeat_interval_seconds")
36 op.execute("PRAGMA foreign_keys=ON")