2236a8b3ee
改动:新增厂商推送配置、设备 push_vendor/push_token 字段、device push-test 接口、心跳超时厂商直推发送逻辑和对应测试。 验证:python -m pytest tests/test_device_push.py tests/test_auth.py tests/test_health.py 通过。
31 lines
935 B
Python
31 lines
935 B
Python
"""add direct vendor push fields
|
|
|
|
Revision ID: direct_vendor_push_fields
|
|
Revises: jd_cps_order_fields
|
|
Create Date: 2026-07-01 16:30:00.000000
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision = "direct_vendor_push_fields"
|
|
down_revision = "jd_cps_order_fields"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
with op.batch_alter_table("device_liveness") as batch_op:
|
|
batch_op.add_column(sa.Column("push_vendor", sa.String(length=32), nullable=True))
|
|
batch_op.add_column(sa.Column("push_token", sa.String(length=256), nullable=True))
|
|
batch_op.create_index("ix_device_liveness_push_vendor", ["push_vendor"])
|
|
|
|
|
|
def downgrade() -> None:
|
|
with op.batch_alter_table("device_liveness") as batch_op:
|
|
batch_op.drop_index("ix_device_liveness_push_vendor")
|
|
batch_op.drop_column("push_token")
|
|
batch_op.drop_column("push_vendor")
|