mirror of
https://github.com/simple-login/app.git
synced 2025-02-25 00:03:03 +08:00
add User.disable_import column
This commit is contained in:
parent
adb376525f
commit
6f4c9f6c5a
2 changed files with 34 additions and 0 deletions
|
@ -407,6 +407,11 @@ class User(Base, ModelMixin, UserMixin, PasswordOracle):
|
|||
"subdomain_quota", sa.Integer, default=5, nullable=False, server_default="5"
|
||||
)
|
||||
|
||||
# user can use import to import too many aliases
|
||||
disable_import = sa.Column(
|
||||
sa.Boolean, default=False, nullable=False, server_default="0"
|
||||
)
|
||||
|
||||
@property
|
||||
def directory_quota(self):
|
||||
return min(
|
||||
|
|
29
migrations/versions/2021_111810_e7d7ebcea26c_.py
Normal file
29
migrations/versions/2021_111810_e7d7ebcea26c_.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: e7d7ebcea26c
|
||||
Revises: b8fd175c084a
|
||||
Create Date: 2021-11-18 10:35:05.122715
|
||||
|
||||
"""
|
||||
import sqlalchemy_utils
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'e7d7ebcea26c'
|
||||
down_revision = 'b8fd175c084a'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('users', sa.Column('disable_import', sa.Boolean(), server_default='0', nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('users', 'disable_import')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in a new issue