Merge "add "reject" action to firewall rule doesn't work for postgresql"

This commit is contained in:
Jenkins 2016-07-13 20:51:46 +00:00 committed by Gerrit Code Review
commit 050b9e052f

View File

@ -20,7 +20,6 @@ Create Date: 2015-04-15 04:19:57.324584
"""
from alembic import op
import sqlalchemy as sa
from neutron.db import migration
@ -38,4 +37,11 @@ new_action = sa.Enum('allow', 'deny', 'reject', name='firewallrules_action')
def upgrade():
op.alter_column('firewall_rules', 'action', type_=new_action)
# NOTE: postgresql have a builtin ENUM type, so just altering the
# column won't works
# https://bitbucket.org/zzzeek/alembic/issues/270/altering-enum-type
# alter_enum that was already invented for such case in neutron
# https://github.com/openstack/neutron/blob/master/neutron/db/migration/__init__.py
migration.alter_enum(
'firewall_rules', 'action', enum_type=new_action, nullable=True)