Skip to content

Commit fb9dcf0

Browse files
authored
HA-464 (fides DB migration) (#5846)
1 parent 6566952 commit fb9dcf0

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

.fides/db_dataset.yml

+2
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,8 @@ dataset:
974974
data_categories: [system.operations]
975975
- name: classification_instances
976976
data_categories: [system.operations]
977+
- name: messages
978+
data_categories: [system.operations]
977979
- name: created_at
978980
data_categories: [system.operations]
979981
- name: updated_at

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Changes can also be flagged with a GitHub label for tracking purposes. The URL o
2323

2424
### Added
2525
- DB model support for Attachments [#5784](https://github.com/ethyca/fides/pull/5784) https://github.com/ethyca/fides/labels/db-migration
26+
- DB model support for messages on `MonitorExecution` records [#5846](https://github.com/ethyca/fides/pull/5846) https://github.com/ethyca/fides/labels/db-migration
2627

2728
### Changed
2829
- Bumped supported Python versions to `3.10.16` and `3.9.21` [#5840](https://github.com/ethyca/fides/pull/5840)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""add errors to monitor execution
2+
3+
Revision ID: 3c58001ad310
4+
Revises: bd875a8b5d96
5+
Create Date: 2025-02-27 20:45:38.462604
6+
7+
"""
8+
9+
import sqlalchemy as sa
10+
from alembic import op
11+
12+
# revision identifiers, used by Alembic.
13+
revision = "3c58001ad310"
14+
down_revision = "bd875a8b5d96"
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade() -> None:
20+
op.add_column(
21+
"monitorexecution",
22+
sa.Column(
23+
"messages",
24+
sa.ARRAY(sa.String()),
25+
nullable=False,
26+
server_default="{}",
27+
),
28+
)
29+
30+
31+
def downgrade() -> None:
32+
op.drop_column("monitorexecution", "messages")

src/fides/api/models/detection_discovery.py

+7
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,13 @@ class MonitorExecution(Base):
398398
nullable=False,
399399
default=list,
400400
)
401+
# stores additional information from monitor execution failures as an array of strings,
402+
# e.g. error messages, stack traces, etc.
403+
messages = Column(
404+
ARRAY(String),
405+
nullable=False,
406+
default=list,
407+
)
401408
created_at = Column(DateTime(timezone=True), server_default=func.now())
402409
updated_at = Column(
403410
DateTime(timezone=True),

0 commit comments

Comments
 (0)