Add Client approved, description columns

This commit is contained in:
Son NK 2021-04-01 10:50:11 +02:00
parent eab4f5f7ac
commit bbfb69d774
2 changed files with 35 additions and 0 deletions

View File

@ -838,6 +838,10 @@ class Client(db.Model, ModelMixin):
user_id = db.Column(db.ForeignKey(User.id, ondelete="cascade"), nullable=False)
icon_id = db.Column(db.ForeignKey(File.id), nullable=True)
# an app needs to be approved by SimpleLogin team
approved = db.Column(db.Boolean, nullable=False, default=False, server_default="0")
description = db.Column(db.Text, nullable=True)
icon = db.relationship(File)
def nb_user(self):

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: 517b79c56088
Revises: f398b261d9c6
Create Date: 2021-04-01 10:49:42.682281
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '517b79c56088'
down_revision = 'f398b261d9c6'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('client', sa.Column('approved', sa.Boolean(), server_default='0', nullable=False))
op.add_column('client', sa.Column('description', sa.Text(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('client', 'description')
op.drop_column('client', 'approved')
# ### end Alembic commands ###