add Contact.automatic_created column to know which contact is created during the forward phase

This commit is contained in:
Son 2022-01-07 10:21:31 +01:00
parent ad622df071
commit 84d1f22a7b
2 changed files with 32 additions and 0 deletions

View File

@ -1541,6 +1541,9 @@ class Contact(Base, ModelMixin):
sa.Boolean, nullable=False, default=False, server_default="0"
)
# whether contact is created automatically during the forward phase
automatic_created = sa.Column(sa.Boolean, nullable=True, default=False)
@property
def email(self):
return self.website_email

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 698424c429e9
Revises: 753d2ed92d41
Create Date: 2022-01-07 10:20:55.711691
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '698424c429e9'
down_revision = '753d2ed92d41'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('contact', sa.Column('automatic_created', sa.Boolean(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('contact', 'automatic_created')
# ### end Alembic commands ###