Fix #529. Update domain serial columns type

This commit is contained in:
Khanh Ngo 2019-12-20 11:36:27 +07:00
parent 5567886aa3
commit 8723b7d56b
No known key found for this signature in database
GPG Key ID: D5FAA6A16150E49E
2 changed files with 37 additions and 2 deletions

View File

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

View File

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