mirror of
https://github.com/simple-login/app.git
synced 2025-09-30 10:25:51 +08:00
Add AppleSubscription.product_id col
This commit is contained in:
parent
30ba566457
commit
e1d82b7e0d
2 changed files with 33 additions and 0 deletions
|
@ -1802,6 +1802,10 @@ class AppleSubscription(Base, ModelMixin):
|
||||||
|
|
||||||
plan = sa.Column(sa.Enum(PlanEnum), nullable=False)
|
plan = sa.Column(sa.Enum(PlanEnum), nullable=False)
|
||||||
|
|
||||||
|
# to know what subscription user has bought
|
||||||
|
# e.g. io.simplelogin.ios_app.subscription.premium.monthly
|
||||||
|
product_id = sa.Column(sa.String(256), nullable=True)
|
||||||
|
|
||||||
user = orm.relationship(User)
|
user = orm.relationship(User)
|
||||||
|
|
||||||
def is_valid(self):
|
def is_valid(self):
|
||||||
|
|
29
migrations/versions/2021_123016_d8a3dfe674f2_.py
Normal file
29
migrations/versions/2021_123016_d8a3dfe674f2_.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
"""empty message
|
||||||
|
|
||||||
|
Revision ID: d8a3dfe674f2
|
||||||
|
Revises: ad467baf7ec8
|
||||||
|
Create Date: 2021-12-30 16:16:33.088147
|
||||||
|
|
||||||
|
"""
|
||||||
|
import sqlalchemy_utils
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = 'd8a3dfe674f2'
|
||||||
|
down_revision = 'ad467baf7ec8'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.add_column('apple_subscription', sa.Column('product_id', sa.String(length=256), nullable=True))
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_column('apple_subscription', 'product_id')
|
||||||
|
# ### end Alembic commands ###
|
Loading…
Add table
Reference in a new issue