diff --git a/app/models.py b/app/models.py index fe2a397b..ae358644 100644 --- a/app/models.py +++ b/app/models.py @@ -1642,6 +1642,8 @@ class Mailbox(db.Model, ModelMixin): # a mailbox can be disabled if it can't be reached disabled = db.Column(db.Boolean, default=False, nullable=False, server_default="0") + generic_subject = db.Column(db.String(78), nullable=True) + __table_args__ = (db.UniqueConstraint("user_id", "email", name="uq_mailbox_user"),) user = db.relationship(User, foreign_keys=[user_id]) diff --git a/migrations/versions/2020_110712_d0f197979bd9_.py b/migrations/versions/2020_110712_d0f197979bd9_.py new file mode 100644 index 00000000..319b8346 --- /dev/null +++ b/migrations/versions/2020_110712_d0f197979bd9_.py @@ -0,0 +1,29 @@ +"""empty message + +Revision ID: d0f197979bd9 +Revises: 84dec6c29c48 +Create Date: 2020-11-07 12:47:44.131900 + +""" +import sqlalchemy_utils +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'd0f197979bd9' +down_revision = '84dec6c29c48' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('mailbox', sa.Column('generic_subject', sa.String(length=78), nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('mailbox', 'generic_subject') + # ### end Alembic commands ###