|
@@ -9,6 +9,7 @@ import EditorialModel
|
9
|
9
|
import EditorialModel.classtypes
|
10
|
10
|
import EditorialModel.fieldtypes
|
11
|
11
|
import EditorialModel.fieldtypes.generic
|
|
12
|
+from EditorialModel.fieldtypes.generic import MultiValueFieldType
|
12
|
13
|
|
13
|
14
|
from DataSource.MySQL import fieldtypes as fieldtypes_utils
|
14
|
15
|
from DataSource.MySQL import utils
|
|
@@ -468,7 +469,7 @@ ADD COLUMN {col_name} {col_type} {col_specs};"""
|
468
|
469
|
tname = utils.object_table_name(emfield.em_class.name)
|
469
|
470
|
tname = utils.multivalue_table_name(tname, ftype.keyname)
|
470
|
471
|
self._del_column(tname, emfield.name)
|
471
|
|
- if len([ f for f in emfield.em_class.fields()]) == 0:
|
|
472
|
+ if len([ f for f in emfield.em_class.fields() if isinstance(f.fieldtype_instance(), MultiValueFieldType)]) == 0:
|
472
|
473
|
try:
|
473
|
474
|
self._query("DROP TABLE %s;" % utils.escape_idname(tname))
|
474
|
475
|
except self._dbmodule.err.InternalError as expt:
|