-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add migration for fc.fc_host CRUD APIs
- Loading branch information
1 parent
a0b1589
commit 54dac2d
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/middlewared/middlewared/alembic/versions/25.04/2024-10-29_18-29_fc_host.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') |