diff --git a/app/models.py b/app/models.py index 512a3050..54e63202 100644 --- a/app/models.py +++ b/app/models.py @@ -450,6 +450,11 @@ class User(Base, ModelMixin, UserMixin, PasswordOracle): server_default=BlockBehaviourEnum.return_2xx.name, ) + # to keep existing behavior, the server default is TRUE whereas for new user, the default value is FALSE + include_header_email_header = sa.Column( + sa.Boolean, default=False, nullable=False, server_default="1" + ) + @property def directory_quota(self): return min( diff --git a/migrations/versions/2022_022512_4729b7096d12_.py b/migrations/versions/2022_022512_4729b7096d12_.py new file mode 100644 index 00000000..9800b92b --- /dev/null +++ b/migrations/versions/2022_022512_4729b7096d12_.py @@ -0,0 +1,29 @@ +"""empty message + +Revision ID: 4729b7096d12 +Revises: 9282e982bc05 +Create Date: 2022-02-25 12:11:10.991810 + +""" +import sqlalchemy_utils +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '4729b7096d12' +down_revision = '9282e982bc05' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('users', sa.Column('include_header_email_header', sa.Boolean(), server_default='1', nullable=False)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('users', 'include_header_email_header') + # ### end Alembic commands ###