Add User.one_click_unsubscribe_block_sender column
This commit is contained in:
parent
caa8656748
commit
368a2f1b47
|
@ -381,6 +381,12 @@ class User(Base, ModelMixin, UserMixin, PasswordOracle):
|
||||||
sa.Boolean, default=False, nullable=False, server_default="0"
|
sa.Boolean, default=False, nullable=False, server_default="0"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# By default, the one-click unsubscribe disable the alias
|
||||||
|
# If set to true, it will block the sender instead
|
||||||
|
one_click_unsubscribe_block_sender = sa.Column(
|
||||||
|
sa.Boolean, default=False, nullable=False, server_default="0"
|
||||||
|
)
|
||||||
|
|
||||||
# implement flask-login "alternative token"
|
# implement flask-login "alternative token"
|
||||||
def get_id(self):
|
def get_id(self):
|
||||||
if self.alternative_id:
|
if self.alternative_id:
|
||||||
|
|
29
migrations/versions/2021_110215_ff6c04869029_.py
Normal file
29
migrations/versions/2021_110215_ff6c04869029_.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
"""empty message
|
||||||
|
|
||||||
|
Revision ID: ff6c04869029
|
||||||
|
Revises: 37feaba7c45d
|
||||||
|
Create Date: 2021-11-02 15:25:51.898330
|
||||||
|
|
||||||
|
"""
|
||||||
|
import sqlalchemy_utils
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = 'ff6c04869029'
|
||||||
|
down_revision = '37feaba7c45d'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.add_column('users', sa.Column('one_click_unsubscribe_block_sender', sa.Boolean(), server_default='0', nullable=False))
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_column('users', 'one_click_unsubscribe_block_sender')
|
||||||
|
# ### end Alembic commands ###
|
Loading…
Reference in a new issue