Set a proper default for spam thresholds

master
Pierre Jaury 8 years ago
parent 1ce0bf2ef7
commit 58337d7dd6

@ -143,7 +143,7 @@ class User(Email):
# Settings # Settings
displayed_name = db.Column(db.String(160), nullable=False, default="") displayed_name = db.Column(db.String(160), nullable=False, default="")
spam_enabled = db.Column(db.Boolean(), nullable=False, default=True) spam_enabled = db.Column(db.Boolean(), nullable=False, default=True)
spam_threshold = db.Column(db.Numeric(), nullable=False, default=5.0) spam_threshold = db.Column(db.Numeric(), nullable=False, default=10.0)
# Flask-login attributes # Flask-login attributes
is_authenticated = True is_authenticated = True

@ -0,0 +1,25 @@
""" Update the spam threshold default value
Revision ID: a4accda8a8c7
Revises: c5696b48442d
Create Date: 2016-08-18 20:34:19.624603
"""
# revision identifiers, used by Alembic.
revision = 'a4accda8a8c7'
down_revision = 'c5696b48442d'
from alembic import op
import sqlalchemy as sa
def upgrade():
with op.batch_alter_table('user') as batch:
batch.drop_column('spam_threshold')
batch.add_column(sa.Column('spam_threshold', sa.Numeric(),
default=10.0))
def downgrade():
pass
Loading…
Cancel
Save