mirror of
https://github.com/simple-login/app.git
synced 2025-02-24 15:53:22 +08:00
add custom_domain.catch_all column
This commit is contained in:
parent
4b6717d8dd
commit
cae43fa0dd
2 changed files with 32 additions and 0 deletions
|
@ -693,5 +693,8 @@ class CustomDomain(db.Model, ModelMixin):
|
||||||
db.Boolean, nullable=False, default=False, server_default="0"
|
db.Boolean, nullable=False, default=False, server_default="0"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# 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")
|
||||||
|
|
||||||
def nb_alias(self):
|
def nb_alias(self):
|
||||||
return GenEmail.filter_by(custom_domain_id=self.id).count()
|
return GenEmail.filter_by(custom_domain_id=self.id).count()
|
||||||
|
|
29
migrations/versions/2019_123018_10ad2dbaeccf_.py
Normal file
29
migrations/versions/2019_123018_10ad2dbaeccf_.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
"""empty message
|
||||||
|
|
||||||
|
Revision ID: 10ad2dbaeccf
|
||||||
|
Revises: 696e17c13b8b
|
||||||
|
Create Date: 2019-12-30 18:16:40.110999
|
||||||
|
|
||||||
|
"""
|
||||||
|
import sqlalchemy_utils
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '10ad2dbaeccf'
|
||||||
|
down_revision = '696e17c13b8b'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.add_column('custom_domain', sa.Column('catch_all', sa.Boolean(), server_default='0', nullable=False))
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_column('custom_domain', 'catch_all')
|
||||||
|
# ### end Alembic commands ###
|
Loading…
Reference in a new issue