Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

1.1 KB
Raw Blame
"""remove scan_id of logs

Revision ID: faceebd6a580
Revises: fa0ab51b2f64
Create Date: 2025-06-07 20:03:48.966194

"""

from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision: str = "faceebd6a580"
down_revision: Union[str, None] = "fa0ab51b2f64"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint("logs_scan_id_fkey", "logs", type_="foreignkey")
    op.drop_column("logs", "scan_id")
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "logs", sa.Column("scan_id", sa.UUID(), autoincrement=False, nullable=True)
    )
    op.create_foreign_key(
        "logs_scan_id_fkey", "logs", "scans", ["scan_id"], ["id"], ondelete="CASCADE"
    )
    # ### end Alembic commands ###