From 9088f9323329c581f95793df7e4c00d21ed2bbd8 Mon Sep 17 00:00:00 2001 From: Robert Walter Date: Tue, 10 Jan 2023 13:49:16 +0100 Subject: [PATCH] Upgrade Database: Changing domain table type column to 8 chars PowerDNS 4.7 is supporting 2 new zone types: "producer" & "consumer" Due to the domain type column is limited to 6 chars, PDA Zone update will fail if producer or cusomer zones exist. To solve this problem, this commit increases the lenght of the domain type column to 8 chars. --- .../f41520e41cee_update_domain_type_length.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 migrations/versions/f41520e41cee_update_domain_type_length.py diff --git a/migrations/versions/f41520e41cee_update_domain_type_length.py b/migrations/versions/f41520e41cee_update_domain_type_length.py new file mode 100644 index 0000000..f4672de --- /dev/null +++ b/migrations/versions/f41520e41cee_update_domain_type_length.py @@ -0,0 +1,31 @@ +"""update domain type length + +Revision ID: f41520e41cee +Revises: 6ea7dc05f496 +Create Date: 2023-01-10 11:56:28.538485 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'f41520e41cee' +down_revision = '6ea7dc05f496' +branch_labels = None +depends_on = None + + +def upgrade(): + with op.batch_alter_table('domain') as batch_op: + batch_op.alter_column('type', + existing_type=sa.String(length=6), + type_=sa.String(length=8)) + + +def downgrade(): + with op.batch_alter_table('domain') as batch_op: + batch_op.alter_column('type', + existing_type=sa.String(length=8), + type_=sa.String(length=6)) +