Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes signal instance fingerprint column #4047

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/dispatch/case/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,11 @@ class SignalRead(DispatchBase):


class SignalInstanceRead(DispatchBase):
signal: SignalRead
created_at: datetime
entities: Optional[List[EntityRead]] = []
tags: Optional[List[TagRead]] = []
raw: Any
fingerprint: Optional[str]
created_at: datetime
signal: SignalRead
tags: Optional[List[TagRead]] = []


class ProjectRead(DispatchBase):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Removes unused fingerprint column from signal instance model

Revision ID: 580a18ec4c39
Revises: bdaeabba3e53
Create Date: 2023-11-29 15:40:12.524085

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = "580a18ec4c39"
down_revision = "bdaeabba3e53"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("signal_instance", "fingerprint")
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"signal_instance",
sa.Column("fingerprint", sa.VARCHAR(), autoincrement=False, nullable=True),
)
# ### end Alembic commands ###
2 changes: 0 additions & 2 deletions src/dispatch/signal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ class SignalInstance(Base, TimeStampMixin, ProjectMixin):
case_type = relationship("CaseType", backref="signal_instances")
case_priority_id = Column(Integer, ForeignKey(CasePriority.id))
case_priority = relationship("CasePriority", backref="signal_instances")
fingerprint = Column(String)
filter_action = Column(String)
canary = Column(Boolean, default=False)
raw = Column(JSONB)
Expand Down Expand Up @@ -381,7 +380,6 @@ class SignalInstanceCreate(SignalInstanceBase):

class SignalInstanceRead(SignalInstanceBase):
id: uuid.UUID
fingerprint: Optional[str]
signal: SignalRead


Expand Down
1 change: 0 additions & 1 deletion tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,6 @@ class SignalInstanceFactory(BaseFactory):
id = LazyFunction(uuid.uuid4)
project = SubFactory(ProjectFactory)
case = SubFactory(CaseFactory)
fingerprint = fake.md5()
signal = SubFactory(SignalFactory)
raw = {
"action": [{"type": "AWS_API_CALL", "value": {"Api": "assumerole", "ServiceName": "sts"}}],
Expand Down
Loading