Add Mailbox.generic_subject column

This commit is contained in:
Son NK 2020-11-07 12:48:44 +01:00
parent 8b356eef01
commit 7cc57106de
2 changed files with 31 additions and 0 deletions

View file

@ -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])

View file

@ -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 ###