mirror of
https://github.com/simple-login/app.git
synced 2025-02-24 15:53:22 +08:00
Add PublicDomain.premium_only column
This commit is contained in:
parent
90163220cf
commit
dcbd7baabc
2 changed files with 40 additions and 1 deletions
|
@ -1795,10 +1795,20 @@ class Notification(db.Model, ModelMixin):
|
|||
|
||||
|
||||
class PublicDomain(db.Model, ModelMixin):
|
||||
"""SimpleLogin domains that all users can use"""
|
||||
"""SimpleLogin domains"""
|
||||
|
||||
domain = db.Column(db.String(128), unique=True, nullable=False)
|
||||
|
||||
# only available for premium accounts
|
||||
premium_only = db.Column(
|
||||
db.Boolean, nullable=False, default=False, server_default="0"
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
return (
|
||||
f"<PublicDomain {self.domain} {'Premium' if self.premium_only else 'Free'}"
|
||||
)
|
||||
|
||||
|
||||
class Monitoring(db.Model, ModelMixin):
|
||||
"""
|
||||
|
|
29
migrations/versions/2020_101516_54ca2dbf89c0_.py
Normal file
29
migrations/versions/2020_101516_54ca2dbf89c0_.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: 54ca2dbf89c0
|
||||
Revises: b17afc77ba83
|
||||
Create Date: 2020-10-15 16:07:57.039554
|
||||
|
||||
"""
|
||||
import sqlalchemy_utils
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '54ca2dbf89c0'
|
||||
down_revision = 'b17afc77ba83'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('public_domain', sa.Column('premium_only', sa.Boolean(), server_default='0', nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('public_domain', 'premium_only')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in a new issue