Files
watcher/watcher/db/sqlalchemy/alembic/versions/52804f2498c4_add_hostname.py
Alexander Chadin e426a015ee Add HA support
This patch set adds hostname field to Audit and Action Plan
objects to track services which execute these objects.

Change-Id: I786e419952925c380c969b12cc60f9a1004af96b
Partially-Implements: blueprint support-watcher-ha-active-active-mode
2018-07-26 12:54:11 +03:00

27 lines
583 B
Python

"""Add hostname field to both Audit and Action Plan models
Revision ID: 52804f2498c4
Revises: a86240e89a29
Create Date: 2018-06-26 13:06:45.530387
"""
# revision identifiers, used by Alembic.
revision = '52804f2498c4'
down_revision = 'a86240e89a29'
from alembic import op
import sqlalchemy as sa
def upgrade():
for table in ('audits', 'action_plans'):
op.add_column(
table,
sa.Column('hostname', sa.String(length=255), nullable=True))
def downgrade():
for table in ('audits', 'action_plans'):
op.drop_column(table, 'hostname')