Add AppleSubscription.product_id col

This commit is contained in:
Son 2021-12-30 16:20:18 +01:00
parent 30ba566457
commit e1d82b7e0d
2 changed files with 33 additions and 0 deletions

View File

@ -1802,6 +1802,10 @@ class AppleSubscription(Base, ModelMixin):
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)
def is_valid(self):

View 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 ###