-
Notifications
You must be signed in to change notification settings - Fork 785
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): keep the failed alerts (#2419)
Signed-off-by: Shahar Glazner <[email protected]> Co-authored-by: Tal <[email protected]>
- Loading branch information
Showing
3 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
keep/api/models/db/migrations/versions/2024-11-08-20-58_895fe80117aa.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"""Add timestamp and provider_type to alertraw | ||
Revision ID: 895fe80117aa | ||
Revises: ef0b5b0df41c | ||
Create Date: 2024-11-08 20:58:40.201477 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "895fe80117aa" | ||
down_revision = "ef0b5b0df41c" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
|
||
with op.batch_alter_table("alertraw", schema=None) as batch_op: | ||
batch_op.add_column( | ||
sa.Column( | ||
"timestamp", | ||
sa.DateTime(), | ||
nullable=False, | ||
server_default=sa.text("CURRENT_TIMESTAMP"), | ||
) | ||
) | ||
batch_op.add_column(sa.Column("provider_type", sa.String(255), nullable=True)) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("alertraw", schema=None) as batch_op: | ||
batch_op.drop_column("timestamp") | ||
batch_op.drop_column("provider_type") | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters