Process remove action if field is in any module
This commit is contained in:
1 parent
cb08fdf3ed
commit
0de3f616df
2 files changed
+6
-3
No files matched your search
@@ -286,7 +286,8 @@ class TableHandler(TableHandlerInterface):
|
||||
self._update_definitions()
|
||||
elif action == 'remove':
|
||||
if len(column_name) == 1:
|
||||
if self._field2module.get(column_name[0]) != self.module_name:
|
||||
if self._field2module.get(column_name[0], self.module_name) \
|
||||
!= self.module_name:
|
||||
return
|
||||
|
||||
if index_name in self._indexes:
|
||||
@@ -322,7 +323,8 @@ class TableHandler(TableHandlerInterface):
|
||||
elif action == 'remove':
|
||||
if not self._columns[column_name]['notnull']:
|
||||
return
|
||||
if self._field2module.get(column_name) != self.module_name:
|
||||
if self._field2module.get(column_name, self.module_name) \
|
||||
!= self.module_name:
|
||||
return
|
||||
self.cursor.execute('ALTER TABLE "%s" ' \
|
||||
'ALTER COLUMN "%s" DROP NOT NULL' %
|
||||
|
||||
@@ -199,7 +199,8 @@ class TableHandler(TableHandlerInterface):
|
||||
self._update_definitions()
|
||||
elif action == 'remove':
|
||||
if len(column_name) == 1:
|
||||
if self._field2module.get(column_name[0]) != self.module_name:
|
||||
if self._field2module.get(column_name[0], self.module_name) \
|
||||
!= self.module_name:
|
||||
return
|
||||
|
||||
if index_name in self._indexes:
|
||||
|
||||
Reference in new issue
Block a user