54337a5917
Store hardware/software snapshots on hosts; warn on hardware changes. Host card from Hosts list. Add agent version column to Events/Overview; rename Hosts table columns and sort by status. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
683 B
Python
27 lines
683 B
Python
"""host inventory JSONB
|
|
|
|
Revision ID: 013
|
|
Revises: 012
|
|
"""
|
|
|
|
from typing import Sequence, Union
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
from sqlalchemy.dialects.postgresql import JSONB
|
|
|
|
revision: str = "013"
|
|
down_revision: Union[str, None] = "012"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column("hosts", sa.Column("inventory", JSONB, nullable=True))
|
|
op.add_column("hosts", sa.Column("inventory_updated_at", sa.DateTime(timezone=True), nullable=True))
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column("hosts", "inventory_updated_at")
|
|
op.drop_column("hosts", "inventory")
|