Add enabled flag to user model

master
Stefan Auditor 7 years ago
parent db0cd8efb4
commit f585197e52

@ -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)

@ -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')
Loading…
Cancel
Save