mirror of
https://github.com/simple-login/app.git
synced 2025-02-20 22:02:54 +08:00
Add contact.name column
This commit is contained in:
parent
5fff1e86ce
commit
fa8e0aee45
2 changed files with 31 additions and 0 deletions
|
@ -728,6 +728,8 @@ class Contact(db.Model, ModelMixin):
|
|||
user_id = db.Column(db.ForeignKey(User.id, ondelete="cascade"), nullable=False)
|
||||
alias_id = db.Column(db.ForeignKey(Alias.id, ondelete="cascade"), nullable=False)
|
||||
|
||||
name = db.Column(db.String(512), nullable=True, default=None, server_default=text("NULL"))
|
||||
|
||||
# used to be envelope header, should be mail header from instead
|
||||
website_email = db.Column(db.String(512), nullable=False)
|
||||
|
||||
|
|
29
migrations/versions/2020_040512_497cfd2a02e2_.py
Normal file
29
migrations/versions/2020_040512_497cfd2a02e2_.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: 497cfd2a02e2
|
||||
Revises: 92baf66b268b
|
||||
Create Date: 2020-04-05 12:17:45.505741
|
||||
|
||||
"""
|
||||
import sqlalchemy_utils
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '497cfd2a02e2'
|
||||
down_revision = '92baf66b268b'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('contact', sa.Column('name', sa.String(length=512), server_default=sa.text('NULL'), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('contact', 'name')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in a new issue