From 58d36e9cd8714f69fa9282cd884cbec400019ca6 Mon Sep 17 00:00:00 2001 From: Son Nguyen Kim Date: Fri, 17 Sep 2021 17:35:36 +0200 Subject: [PATCH] add CustomDomain.auto_create_regex column --- app/models.py | 3 ++ .../versions/2021_091716_d8c55e79da54_.py | 29 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 migrations/versions/2021_091716_d8c55e79da54_.py diff --git a/app/models.py b/app/models.py index de1972b4..49517a56 100644 --- a/app/models.py +++ b/app/models.py @@ -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" diff --git a/migrations/versions/2021_091716_d8c55e79da54_.py b/migrations/versions/2021_091716_d8c55e79da54_.py new file mode 100644 index 00000000..c9c57c6a --- /dev/null +++ b/migrations/versions/2021_091716_d8c55e79da54_.py @@ -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 ###