diff --git a/migrations/versions/b0fea72a3f20_update_domain_serial_columns_type.py b/migrations/versions/b0fea72a3f20_update_domain_serial_columns_type.py new file mode 100644 index 0000000..4aae961 --- /dev/null +++ b/migrations/versions/b0fea72a3f20_update_domain_serial_columns_type.py @@ -0,0 +1,35 @@ +"""Update domain serial columns type + +Revision ID: b0fea72a3f20 +Revises: 856bb94b7040 +Create Date: 2019-12-20 09:18:51.541569 + +""" +from alembic import op +import sqlalchemy as sa + +# revision identifiers, used by Alembic. +revision = 'b0fea72a3f20' +down_revision = '856bb94b7040' +branch_labels = None +depends_on = None + + +def upgrade(): + with op.batch_alter_table('domain') as batch_op: + batch_op.alter_column('serial', + existing_type=sa.Integer(), + type_=sa.BigInteger()) + batch_op.alter_column('notified_serial', + existing_type=sa.Integer(), + type_=sa.BigInteger()) + + +def downgrade(): + with op.batch_alter_table('domain') as batch_op: + batch_op.alter_column('serial', + existing_type=sa.BigInteger(), + type_=sa.Integer()) + batch_op.alter_column('notified_serial', + existing_type=sa.BigInteger(), + type_=sa.Integer()) diff --git a/powerdnsadmin/models/domain.py b/powerdnsadmin/models/domain.py index be966b0..53a122a 100644 --- a/powerdnsadmin/models/domain.py +++ b/powerdnsadmin/models/domain.py @@ -20,8 +20,8 @@ class Domain(db.Model): name = db.Column(db.String(255), index=True, unique=True) master = db.Column(db.String(128)) type = db.Column(db.String(6), nullable=False) - serial = db.Column(db.Integer) - notified_serial = db.Column(db.Integer) + serial = db.Column(db.BigInteger) + notified_serial = db.Column(db.BigInteger) last_check = db.Column(db.Integer) dnssec = db.Column(db.Integer) account_id = db.Column(db.Integer, db.ForeignKey('account.id'))