change quota columns to bigint

master
hoellen 6 years ago
parent 9175b15d49
commit 2af540a1c9

@ -131,7 +131,7 @@ class Domain(Base):
backref=db.backref('manager_of'), lazy='dynamic') backref=db.backref('manager_of'), lazy='dynamic')
max_users = db.Column(db.Integer, nullable=False, default=-1) max_users = db.Column(db.Integer, nullable=False, default=-1)
max_aliases = db.Column(db.Integer, nullable=False, default=-1) max_aliases = db.Column(db.Integer, nullable=False, default=-1)
max_quota_bytes = db.Column(db.Integer(), nullable=False, default=0) max_quota_bytes = db.Column(db.BigInteger(), nullable=False, default=0)
signup_enabled = db.Column(db.Boolean(), nullable=False, default=False) signup_enabled = db.Column(db.Boolean(), nullable=False, default=False)
@property @property
@ -307,8 +307,8 @@ class User(Base, Email):
domain = db.relationship(Domain, domain = db.relationship(Domain,
backref=db.backref('users', cascade='all, delete-orphan')) backref=db.backref('users', cascade='all, delete-orphan'))
password = db.Column(db.String(255), nullable=False) password = db.Column(db.String(255), nullable=False)
quota_bytes = db.Column(db.Integer(), nullable=False, default=10**9) quota_bytes = db.Column(db.BigInteger(), nullable=False, default=10**9)
quota_bytes_used = db.Column(db.Integer(), nullable=False, default=0) quota_bytes_used = db.Column(db.BigInteger(), nullable=False, default=0)
global_admin = db.Column(db.Boolean(), nullable=False, default=False) global_admin = db.Column(db.Boolean(), nullable=False, default=False)
enabled = db.Column(db.Boolean(), nullable=False, default=True) enabled = db.Column(db.Boolean(), nullable=False, default=True)

@ -15,7 +15,7 @@ import sqlalchemy as sa
def upgrade(): def upgrade():
op.add_column('domain', sa.Column('max_quota_bytes', sa.Integer(), nullable=False, server_default='0')) op.add_column('domain', sa.Column('max_quota_bytes', sa.BigInteger(), nullable=False, server_default='0'))
def downgrade(): def downgrade():

@ -20,7 +20,7 @@ import sqlalchemy as sa
def upgrade(): def upgrade():
with op.batch_alter_table('user') as batch: with op.batch_alter_table('user') as batch:
batch.add_column(sa.Column('quota_bytes_used', sa.Integer(), nullable=False, server_default='0')) batch.add_column(sa.Column('quota_bytes_used', sa.BigInteger(), nullable=False, server_default='0'))
def downgrade(): def downgrade():

@ -41,7 +41,7 @@ def upgrade():
sa.Column('comment', sa.String(length=255), nullable=True), sa.Column('comment', sa.String(length=255), nullable=True),
sa.Column('localpart', sa.String(length=80), nullable=False), sa.Column('localpart', sa.String(length=80), nullable=False),
sa.Column('password', sa.String(length=255), nullable=False), sa.Column('password', sa.String(length=255), nullable=False),
sa.Column('quota_bytes', sa.Integer(), nullable=False), sa.Column('quota_bytes', sa.BigInteger(), nullable=False),
sa.Column('global_admin', sa.Boolean(), nullable=False), sa.Column('global_admin', sa.Boolean(), nullable=False),
sa.Column('enable_imap', sa.Boolean(), nullable=False), sa.Column('enable_imap', sa.Boolean(), nullable=False),
sa.Column('enable_pop', sa.Boolean(), nullable=False), sa.Column('enable_pop', sa.Boolean(), nullable=False),

Loading…
Cancel
Save