From 54dac2dea855099cbe5993ad8fc77ed1463bf177 Mon Sep 17 00:00:00 2001 From: Brian M Date: Tue, 29 Oct 2024 11:36:41 -0700 Subject: [PATCH] Add migration for fc.fc_host CRUD APIs --- .../25.04/2024-10-29_18-29_fc_host.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/middlewared/middlewared/alembic/versions/25.04/2024-10-29_18-29_fc_host.py diff --git a/src/middlewared/middlewared/alembic/versions/25.04/2024-10-29_18-29_fc_host.py b/src/middlewared/middlewared/alembic/versions/25.04/2024-10-29_18-29_fc_host.py new file mode 100644 index 0000000000000..48d4cec6d5e3c --- /dev/null +++ b/src/middlewared/middlewared/alembic/versions/25.04/2024-10-29_18-29_fc_host.py @@ -0,0 +1,35 @@ +"""Add table for fc.fc_host CRUD APIs + +Revision ID: 19900774fe2c +Revises: a4ce4939b908 +Create Date: 2024-10-29 18:29:24.171303+00:00 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '19900774fe2c' +down_revision = 'a4ce4939b908' +branch_labels = None +depends_on = None + + +def upgrade(): + op.create_table('services_fc_host', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('fc_host_alias', sa.String(length=32), nullable=False), + sa.Column('fc_host_wwpn', sa.String(length=20), nullable=True), + sa.Column('fc_host_wwpn_b', sa.String(length=20), nullable=True), + sa.Column('fc_host_npiv', sa.Integer(), nullable=False), + sa.PrimaryKeyConstraint('id', name=op.f('pk_services_fc_host')), + sa.UniqueConstraint('fc_host_alias', name=op.f('uq_services_fc_host_fc_host_alias')), + sa.UniqueConstraint('fc_host_wwpn', name=op.f('uq_services_fc_host_fc_host_wwpn')), + sa.UniqueConstraint('fc_host_wwpn_b', name=op.f('uq_services_fc_host_fc_host_wwpn_b')), + sqlite_autoincrement=True + ) + + +def downgrade(): + op.drop_table('services_fc_host')