Преглед на файлове

Added a condition on the field creation to consider only the documents of the class corresponding to the field

Roland Haroutiounian преди 8 години
родител
ревизия
ffa911b22e
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2
    1
      plugins/mongodb_datasource/migration_handler.py

+ 2
- 1
plugins/mongodb_datasource/migration_handler.py Целия файл

@@ -161,7 +161,8 @@ class MongoDbMigrationHandler(object):
161 161
     # @param field str
162 162
     # @param options dict
163 163
     def _create_field_in_collection(self, collection_name, field, options):
164
-        self.database[collection_name].update_many({field: {'$exists': False}}, {'$set': {field: options['default']}}, False)
164
+        emfield = EmField(field)
165
+        self.database[collection_name].update_many({'uid': emfield.get_emclass_uid(), field: {'$exists': False}}, {'$set': {field: options['default']}}, False)
165 166
 
166 167
     ## @brief Deletes a field in a collection
167 168
     # @param collection_name str

Loading…
Отказ
Запис