update
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 4m49s
CI/CD Pipeline / Security Scanning (push) Successful in 15s
CI/CD Pipeline / Tests (3.11) (push) Successful in 9m41s
CI/CD Pipeline / Tests (3.12) (push) Successful in 9m36s
CI/CD Pipeline / Build Docker Image (push) Has been skipped
Dependency Updates / Update Dependencies (push) Successful in 29s
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 4m49s
CI/CD Pipeline / Security Scanning (push) Successful in 15s
CI/CD Pipeline / Tests (3.11) (push) Successful in 9m41s
CI/CD Pipeline / Tests (3.12) (push) Successful in 9m36s
CI/CD Pipeline / Build Docker Image (push) Has been skipped
Dependency Updates / Update Dependencies (push) Successful in 29s
This commit is contained in:
37
migrations/versions/20260117_add_banned_word_metadata.py
Normal file
37
migrations/versions/20260117_add_banned_word_metadata.py
Normal file
@@ -0,0 +1,37 @@
|
||||
"""Add metadata fields for managed banned words.
|
||||
|
||||
Revision ID: 20260117_add_banned_word_metadata
|
||||
Revises: 20260117_enable_ai_defaults
|
||||
Create Date: 2026-01-17 21:15:00.000000
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "20260117_add_banned_word_metadata"
|
||||
down_revision = "20260117_enable_ai_defaults"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column(
|
||||
"banned_words",
|
||||
sa.Column("source", sa.String(length=100), nullable=True),
|
||||
)
|
||||
op.add_column(
|
||||
"banned_words",
|
||||
sa.Column("category", sa.String(length=20), nullable=True),
|
||||
)
|
||||
op.add_column(
|
||||
"banned_words",
|
||||
sa.Column("managed", sa.Boolean(), nullable=False, server_default=sa.text("false")),
|
||||
)
|
||||
op.alter_column("banned_words", "managed", server_default=None)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column("banned_words", "managed")
|
||||
op.drop_column("banned_words", "category")
|
||||
op.drop_column("banned_words", "source")
|
||||
41
migrations/versions/20260117_enable_ai_defaults.py
Normal file
41
migrations/versions/20260117_enable_ai_defaults.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""Enable AI moderation defaults for existing guilds.
|
||||
|
||||
Revision ID: 20260117_enable_ai_defaults
|
||||
Revises: 20260117_analytics
|
||||
Create Date: 2026-01-17 21:00:00.000000
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "20260117_enable_ai_defaults"
|
||||
down_revision = "20260117_analytics"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.execute(
|
||||
sa.text(
|
||||
"""
|
||||
UPDATE guild_settings
|
||||
SET ai_moderation_enabled = TRUE,
|
||||
nsfw_detection_enabled = TRUE,
|
||||
ai_sensitivity = 80
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.execute(
|
||||
sa.text(
|
||||
"""
|
||||
UPDATE guild_settings
|
||||
SET ai_moderation_enabled = FALSE,
|
||||
nsfw_detection_enabled = FALSE,
|
||||
ai_sensitivity = 50
|
||||
"""
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user