mirror of
https://github.com/simple-login/app.git
synced 2025-02-22 14:53:34 +08:00
Add EmailLog is_spam, spam_status column
This commit is contained in:
parent
7c0e4b369a
commit
9563b706f2
2 changed files with 35 additions and 0 deletions
|
@ -786,6 +786,10 @@ class EmailLog(db.Model, ModelMixin):
|
|||
# usually because the forwarded email is too spammy
|
||||
bounced = db.Column(db.Boolean, nullable=False, default=False, server_default="0")
|
||||
|
||||
# SpamAssassin result
|
||||
is_spam = db.Column(db.Boolean, nullable=False, default=False, server_default="0")
|
||||
spam_status = db.Column(db.Text, nullable=True, default=None)
|
||||
|
||||
# Point to the email that has been refused
|
||||
refused_email_id = db.Column(
|
||||
db.ForeignKey("refused_email.id", ondelete="SET NULL"), nullable=True
|
||||
|
|
31
migrations/versions/2020_033017_92baf66b268b_.py
Normal file
31
migrations/versions/2020_033017_92baf66b268b_.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: 92baf66b268b
|
||||
Revises: 224fd8963462
|
||||
Create Date: 2020-03-30 17:48:21.584864
|
||||
|
||||
"""
|
||||
import sqlalchemy_utils
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '92baf66b268b'
|
||||
down_revision = '224fd8963462'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('email_log', sa.Column('is_spam', sa.Boolean(), server_default='0', nullable=False))
|
||||
op.add_column('email_log', sa.Column('spam_status', sa.Text(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('email_log', 'spam_status')
|
||||
op.drop_column('email_log', 'is_spam')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in a new issue