diff --git a/core/admin/migrations/versions/2335c80a6bc3_.py b/core/admin/migrations/versions/2335c80a6bc3_.py index 43d03547..ac5c1e83 100644 --- a/core/admin/migrations/versions/2335c80a6bc3_.py +++ b/core/admin/migrations/versions/2335c80a6bc3_.py @@ -15,7 +15,7 @@ import sqlalchemy as sa def upgrade(): - op.add_column('domain', sa.Column('max_quota_bytes', sa.BigInteger(), nullable=False, server_default='0')) + op.add_column('domain', sa.Column('max_quota_bytes', sa.Integer(), nullable=False, server_default='0')) def downgrade(): diff --git a/core/admin/migrations/versions/25fd6c7bcb4a_.py b/core/admin/migrations/versions/25fd6c7bcb4a_.py index 6e89d2c3..cf9a0fc7 100644 --- a/core/admin/migrations/versions/25fd6c7bcb4a_.py +++ b/core/admin/migrations/versions/25fd6c7bcb4a_.py @@ -20,7 +20,7 @@ import sqlalchemy as sa def upgrade(): with op.batch_alter_table('user') as batch: - batch.add_column(sa.Column('quota_bytes_used', sa.BigInteger(), nullable=False, server_default='0')) + batch.add_column(sa.Column('quota_bytes_used', sa.Integer(), nullable=False, server_default='0')) def downgrade(): diff --git a/core/admin/migrations/versions/3b7eee912b41_.py b/core/admin/migrations/versions/3b7eee912b41_.py new file mode 100644 index 00000000..17f1e0ef --- /dev/null +++ b/core/admin/migrations/versions/3b7eee912b41_.py @@ -0,0 +1,30 @@ +"""change quota type to bigint + +Revision ID: 3b7eee912b41 +Revises: fc099bd15cbe +Create Date: 2019-01-15 08:51:05.346257 + +""" + +# revision identifiers, used by Alembic. +revision = '3b7eee912b41' +down_revision = 'fc099bd15cbe' + +from alembic import op +import sqlalchemy as sa + +def upgrade(): + with op.batch_alter_table('domain') as batch: + batch.alter_column('max_quota_bytes', type_=sa.BigInteger(), nullable=False, server_default='0') + + with op.batch_alter_table('user') as batch: + batch.alter_column('quota_bytes', type_=sa.BigInteger(), nullable=False) + batch.alter_column('quota_bytes_used', type_=sa.BigInteger(), nullable=False, server_default='0') + +def downgrade(): + with op.batch_alter_table('domain') as batch: + batch.alter_column('max_quota_bytes', type_=sa.Integer(), nullable=False, server_default='0') + + with op.batch_alter_table('user') as batch: + batch.alter_column('quota_bytes', type_=sa.Integer(), nullable=False) + batch.alter_column('quota_bytes_used', type_=sa.Integer(), nullable=False, server_default='0') diff --git a/core/admin/migrations/versions/ff0417f4318f_.py b/core/admin/migrations/versions/ff0417f4318f_.py index 99411087..7c92f241 100644 --- a/core/admin/migrations/versions/ff0417f4318f_.py +++ b/core/admin/migrations/versions/ff0417f4318f_.py @@ -41,7 +41,7 @@ def upgrade(): sa.Column('comment', sa.String(length=255), nullable=True), sa.Column('localpart', sa.String(length=80), nullable=False), sa.Column('password', sa.String(length=255), nullable=False), - sa.Column('quota_bytes', sa.BigInteger(), nullable=False), + sa.Column('quota_bytes', sa.Integer(), nullable=False), sa.Column('global_admin', sa.Boolean(), nullable=False), sa.Column('enable_imap', sa.Boolean(), nullable=False), sa.Column('enable_pop', sa.Boolean(), nullable=False),