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
This commit is contained in:
xiaoli 2017-07-04 17:47:33 +08:00
parent 1245b3c4a0
commit 4e1fd1a62b

View File

@ -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)