Add the ability to disallow words (banned words)

This commit is contained in:
Jeremy Zhang
2018-07-09 01:37:35 +00:00
parent f0f1f226e3
commit ccf9aed9ec
11 changed files with 601 additions and 0 deletions

View File

@ -0,0 +1,32 @@
"""Add banned words columns
Revision ID: 8e806bcb2228
Revises: 176d26252734
Create Date: 2018-07-08 23:26:18.412175
"""
# revision identifiers, used by Alembic.
revision = '8e806bcb2228'
down_revision = '176d26252734'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('guilds', sa.Column('banned_words', sa.Text(), server_default='[]', nullable=False))
op.add_column('guilds', sa.Column('banned_words_enabled', sa.Boolean(), server_default='0', nullable=False))
op.add_column('guilds', sa.Column('banned_words_global_included', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('guilds', 'banned_words_global_included')
op.drop_column('guilds', 'banned_words_enabled')
op.drop_column('guilds', 'banned_words')
# ### end Alembic commands ###