20 lines
551 B
Python
20 lines
551 B
Python
"""记下代理最近一次被采集到的时间,便于清掉长期失效的节点。"""
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
revision = "0008_proxy_last_seen"
|
|
down_revision = "0007_study_start_day"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
with op.batch_alter_table("proxy_nodes") as batch:
|
|
batch.add_column(sa.Column("last_seen_at", sa.DateTime(timezone=True), nullable=True))
|
|
|
|
|
|
def downgrade() -> None:
|
|
with op.batch_alter_table("proxy_nodes") as batch:
|
|
batch.drop_column("last_seen_at")
|