<filename>irrd/storage/alembic/versions/b175c262448f_set_rpsl_prefix.py
"""set_rpsl_prefix

Revision ID: b175c262448f
Revises: <PASSWORD>
Create Date: 2021-03-01 15:40:03.546705

"""
from alembic import op


# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    connection = op.get_bind()
    connection.execute("update rpsl_objects set prefix=(host(ip_first) || '/' || prefix_length)::cidr where object_class in ('route', 'route6', 'inet6num');")


def downgrade():
    pass

<filename>irrd/storage/alembic/versions/b175c262448f_set_rpsl_prefix.py
"""set_rpsl_prefix

Revision ID: b175c262448f
Revises: <PASSWORD>
Create Date: 2021-03-01 15:40:03.546705

"""
from alembic import op


# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    connection = op.get_bind()
    connection.execute("update rpsl_objects set prefix=(host(ip_first) || '/' || prefix_length)::cidr where object_class in ('route', 'route6', 'inet6num');")


def downgrade():
    pass

set_rpsl_prefix  Revision ID: b175c262448f Revises: <PASSWORD> Create Date: 2021-03-01 15:40:03.546705 # revision identifiers, used by Alembic.