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
42 lines
917 B
Python
42 lines
917 B
Python
"""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
|
|
"""
|
|
)
|
|
)
|