add gen_email.automatic_creation column

This commit is contained in:
Son NK 2019-12-30 18:48:07 +01:00
parent f08ca682c0
commit 174ee174f9
2 changed files with 34 additions and 0 deletions

View File

@ -420,6 +420,11 @@ class GenEmail(db.Model, ModelMixin):
db.ForeignKey("custom_domain.id", ondelete="cascade"), nullable=True
)
# To know whether an alias is created "on the fly", i.e. via the custom domain catch-all feature
automatic_creation = db.Column(
db.Boolean, nullable=False, default=False, server_default="0"
)
user = db.relationship(User)
@classmethod

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 01f808f15b2e
Revises: 10ad2dbaeccf
Create Date: 2019-12-30 18:47:17.726860
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '01f808f15b2e'
down_revision = '10ad2dbaeccf'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('gen_email', sa.Column('automatic_creation', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('gen_email', 'automatic_creation')
# ### end Alembic commands ###