Skip to content
This repository was archived by the owner on Dec 11, 2021. It is now read-only.
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""
Add DM Sent field to infractions model.

Revision ID: 3d9c7f4c3e4c
Revises: c551b4b47800
Create Date: 2021-11-10 22:26:00.101691
"""
import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = '3d9c7f4c3e4c'
down_revision = 'c551b4b47800'
branch_labels = None
depends_on = None


def upgrade() -> None:
"""Commands auto generated by Alembic."""
op.add_column('api_infraction', sa.Column('dm_sent', sa.Boolean(), nullable=True))


def downgrade() -> None:
"""Commands auto generated by Alembic."""
op.drop_column('api_infraction', 'dm_sent')
3 changes: 3 additions & 0 deletions api/core/database/models/api/bot/infraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class Infraction(Base):
# Whether the infraction is a shadow infraction.
hidden = Column(Boolean, nullable=False)

# Whether a DM was sent to the user when infraction was applied.
dm_sent = Column(Boolean, nullable=True)

actor_id = Column(
ForeignKey(
"api_user.id", deferrable=True, initially="DEFERRED", ondelete="CASCADE"
Expand Down