mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 08:58:30 +01:00
add User.trial_end column
This commit is contained in:
parent
9f95edf203
commit
354e5f9a67
2 changed files with 34 additions and 0 deletions
|
@ -122,6 +122,11 @@ class User(db.Model, ModelMixin, UserMixin):
|
||||||
# some users could have lifetime premium
|
# some users could have lifetime premium
|
||||||
lifetime = db.Column(db.Boolean, default=False, nullable=False, server_default="0")
|
lifetime = db.Column(db.Boolean, default=False, nullable=False, server_default="0")
|
||||||
|
|
||||||
|
# user can use all premium features until this date
|
||||||
|
trial_end = db.Column(
|
||||||
|
ArrowType, default=lambda: arrow.now().shift(days=7), nullable=True
|
||||||
|
)
|
||||||
|
|
||||||
profile_picture = db.relationship(File)
|
profile_picture = db.relationship(File)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
29
migrations/versions/2020_013010_7c39ba4ec38d_.py
Normal file
29
migrations/versions/2020_013010_7c39ba4ec38d_.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
"""empty message
|
||||||
|
|
||||||
|
Revision ID: 7c39ba4ec38d
|
||||||
|
Revises: ba6f13ccbabb
|
||||||
|
Create Date: 2020-01-30 10:10:01.245257
|
||||||
|
|
||||||
|
"""
|
||||||
|
import sqlalchemy_utils
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '7c39ba4ec38d'
|
||||||
|
down_revision = 'ba6f13ccbabb'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.add_column('users', sa.Column('trial_end', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True))
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_column('users', 'trial_end')
|
||||||
|
# ### end Alembic commands ###
|
Loading…
Reference in a new issue