30 lines
857 B
Python
30 lines
857 B
Python
|
|
"""add ip_address column to device table
|
||
|
|
|
||
|
|
Revision ID: 20241119_add_ip_address_to_device
|
||
|
|
Revises: abcd1234
|
||
|
|
Create Date: 2024-11-19 10:00:00.000000
|
||
|
|
|
||
|
|
"""
|
||
|
|
from alembic import op
|
||
|
|
import sqlalchemy as sa
|
||
|
|
|
||
|
|
|
||
|
|
# revision identifiers, used by Alembic.
|
||
|
|
revision = '20241119_add_ip_address_to_device'
|
||
|
|
down_revision = 'abcd1234'
|
||
|
|
branch_labels = None
|
||
|
|
depends_on = None
|
||
|
|
|
||
|
|
|
||
|
|
def upgrade():
|
||
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
|
with op.batch_alter_table('device', schema=None) as batch_op:
|
||
|
|
batch_op.add_column(sa.Column('ip_address', sa.String(length=45), nullable=True))
|
||
|
|
# ### end Alembic commands ###
|
||
|
|
|
||
|
|
|
||
|
|
def downgrade():
|
||
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
|
with op.batch_alter_table('device', schema=None) as batch_op:
|
||
|
|
batch_op.drop_column('ip_address')
|
||
|
|
# ### end Alembic commands ###
|