|
|
|
|
9
|
import EditorialModel.classtypes
|
9
|
import EditorialModel.classtypes
|
10
|
import EditorialModel.fieldtypes
|
10
|
import EditorialModel.fieldtypes
|
11
|
import EditorialModel.fieldtypes.generic
|
11
|
import EditorialModel.fieldtypes.generic
|
|
|
12
|
+from EditorialModel.fieldtypes.generic import MultiValueFieldType
|
12
|
|
13
|
|
13
|
from DataSource.MySQL import fieldtypes as fieldtypes_utils
|
14
|
from DataSource.MySQL import fieldtypes as fieldtypes_utils
|
14
|
from DataSource.MySQL import utils
|
15
|
from DataSource.MySQL import utils
|
|
|
|
|
468
|
tname = utils.object_table_name(emfield.em_class.name)
|
469
|
tname = utils.object_table_name(emfield.em_class.name)
|
469
|
tname = utils.multivalue_table_name(tname, ftype.keyname)
|
470
|
tname = utils.multivalue_table_name(tname, ftype.keyname)
|
470
|
self._del_column(tname, emfield.name)
|
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
|
try:
|
473
|
try:
|
473
|
self._query("DROP TABLE %s;" % utils.escape_idname(tname))
|
474
|
self._query("DROP TABLE %s;" % utils.escape_idname(tname))
|
474
|
except self._dbmodule.err.InternalError as expt:
|
475
|
except self._dbmodule.err.InternalError as expt:
|