From 4e1fd1a62b38e4809e58799babb57772130cd2c1 Mon Sep 17 00:00:00 2001 From: xiaoli Date: Tue, 4 Jul 2017 17:47:33 +0800 Subject: [PATCH] Modify the execution of alter_enum_add_value SQL '%' (value) s in the execution SQL statement of alter_enum_add_value should be decorated with ' ' Ralated commit I4767222ba97d9c35c011adfc187b2977975f981a Change-Id: I24138e5b4ec8b3c3126ae5ff79e26ecb91a65d69 --- neutron/db/migration/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/db/migration/__init__.py b/neutron/db/migration/__init__.py index 26ee66e2f20..bd185cdbf0b 100644 --- a/neutron/db/migration/__init__.py +++ b/neutron/db/migration/__init__.py @@ -124,7 +124,7 @@ def alter_enum_add_value(table, column, new_value, enum, nullable): if engine.name == 'postgresql': values = {'value': new_value, 'name': enum.name} - op.execute("ALTER TYPE %(name)s ADD VALUE %(value)s" % values) + op.execute("ALTER TYPE %(name)s ADD VALUE '%(value)s'" % values) else: op.alter_column(table, column, type_=enum, existing_nullable=nullable)