1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-01-14 02:34:22 +02:00

Add enabled flag to user model

This commit is contained in:
Stefan Auditor 2018-04-15 11:23:58 +02:00
parent db0cd8efb4
commit f585197e52
2 changed files with 25 additions and 0 deletions

View File

@ -183,6 +183,7 @@ class User(Base, Email):
password = db.Column(db.String(255), nullable=False)
quota_bytes = db.Column(db.Integer(), nullable=False, default=10**9)
global_admin = db.Column(db.Boolean(), nullable=False, default=False)
enabled = db.Column(db.Boolean(), nullable=False, default=True)
# Features
enable_imap = db.Column(db.Boolean(), nullable=False, default=True)

View File

@ -0,0 +1,24 @@
""" Add enabled flag to user model
Revision ID: 49d77a93118e
Revises: 423155f8fc15
Create Date: 2018-04-15 11:17:32.306088
"""
# revision identifiers, used by Alembic.
revision = '49d77a93118e'
down_revision = '423155f8fc15'
from alembic import op
import sqlalchemy as sa
def upgrade():
with op.batch_alter_table('user') as batch:
batch.add_column(sa.Column('enabled', sa.Boolean(), nullable=False, server_default=sa.sql.expression.true()))
def downgrade():
with op.batch_alter_table('user') as batch:
batch.drop_column('user', 'enabled')