add CustomDomain.auto_create_regex column

This commit is contained in:
Son Nguyen Kim 2021-09-17 17:35:36 +02:00
parent b990c052ac
commit 58d36e9cd8
2 changed files with 32 additions and 0 deletions

View File

@ -1811,6 +1811,9 @@ class CustomDomain(db.Model, ModelMixin):
# an alias is created automatically the first time it receives an email
catch_all = db.Column(db.Boolean, nullable=False, default=False, server_default="0")
# an alias is auto created if it matches the regex
auto_create_regex = db.Column(db.String(512), nullable=True)
# option to generate random prefix version automatically
random_prefix_generation = db.Column(
db.Boolean, nullable=False, default=False, server_default="0"

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: d8c55e79da54
Revises: 4d3f91ddf3e9
Create Date: 2021-09-17 16:30:23.299011
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd8c55e79da54'
down_revision = '4d3f91ddf3e9'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('custom_domain', sa.Column('auto_create_regex', sa.String(length=512), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('custom_domain', 'auto_create_regex')
# ### end Alembic commands ###