mirror of
https://github.com/simple-login/app.git
synced 2025-02-23 15:23:27 +08:00
Add User.intro_shown column
This commit is contained in:
parent
18b7c7d495
commit
dee6d4959d
2 changed files with 34 additions and 0 deletions
|
@ -160,6 +160,11 @@ class User(db.Model, ModelMixin, UserMixin):
|
|||
|
||||
referral = db.relationship("Referral", foreign_keys=[referral_id])
|
||||
|
||||
# whether intro has been shown to user
|
||||
intro_shown = db.Column(
|
||||
db.Boolean, default=False, nullable=False, server_default="0"
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def create(cls, email, name, password=None, **kwargs):
|
||||
user: User = super(User, cls).create(email=email, name=name, **kwargs)
|
||||
|
|
29
migrations/versions/2020_041313_bfd7b2302903_.py
Normal file
29
migrations/versions/2020_041313_bfd7b2302903_.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: bfd7b2302903
|
||||
Revises: ea30c0b5b2e3
|
||||
Create Date: 2020-04-13 13:21:14.857574
|
||||
|
||||
"""
|
||||
import sqlalchemy_utils
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'bfd7b2302903'
|
||||
down_revision = 'ea30c0b5b2e3'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('users', sa.Column('intro_shown', sa.Boolean(), server_default='0', nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('users', 'intro_shown')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in a new issue