{"action":"created","issue":{"url":"https://api.github.com/repos/Yuego/django-fias/issues/61","repository_url":"https://api.github.com/repos/Yuego/django-fias","labels_url":"https://api.github.com/repos/Yuego/django-fias/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/Yuego/django-fias/issues/61/comments","events_url":"https://api.github.com/repos/Yuego/django-fias/issues/61/events","html_url":"https://github.com/Yuego/django-fias/issues/61","id":179143701,"number":61,"title":"Дубли записей в таблице ROOM","user":{"login":"Sky-Cat","id":5306467,"avatar_url":"https://avatars.githubusercontent.com/u/5306467?v=3","gravatar_id":"","url":"https://api.github.com/users/Sky-Cat","html_url":"https://github.com/Sky-Cat","followers_url":"https://api.github.com/users/Sky-Cat/followers","following_url":"https://api.github.com/users/Sky-Cat/following{/other_user}","gists_url":"https://api.github.com/users/Sky-Cat/gists{/gist_id}","starred_url":"https://api.github.com/users/Sky-Cat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sky-Cat/subscriptions","organizations_url":"https://api.github.com/users/Sky-Cat/orgs","repos_url":"https://api.github.com/users/Sky-Cat/repos","events_url":"https://api.github.com/users/Sky-Cat/events{/privacy}","received_events_url":"https://api.github.com/users/Sky-Cat/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Yuego/django-fias/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-26T05:40:59Z","updated_at":"2016-09-27T11:18:55Z","closed_at":null,"body":"При импорте данных из таблицы room программа вылетает с ошибкой\r\n\r\n`django.db.utils.IntegrityError: (1062, \"Duplicate entry '47aab24a73084c6c8756787b7172076a' for key 'fias_room_roomguid_f8e479d0_uniq'\")`\r\n\r\nПодскажите, пожалуйста, можно ли как-то пропускать дубли и продолжать импорт данных?\r\n\r\nЗапускаю полный импорт так:\r\n\r\n`python manage.py fias --src auto --format xml`\r\n\r\nПолный лог ошибок:\r\n\r\n```\r\nT: room. L: 68453 | U: 0 | S: 486925[E:472683] | R: 0[0]        FN: AS_ROOM_20160922_67c6a747-b702-4759-9542-d78b90c9b4f4.XML\r\nTraceback (most recent call last):\r\n  File \"manage.py\", line 10, in <module>\r\n    execute_from_command_line(sys.argv)\r\n  File \"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py\", line 353, in execute_from_command_line\r\n    utility.execute()\r\n  File \"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py\", line 345, in execute\r\n    self.fetch_command(subcommand).run_from_argv(self.argv)\r\n  File \"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py\", line 348, in run_from_argv\r\n    self.execute(*args, **cmd_options)\r\n  File \"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py\", line 399, in execute\r\n    output = self.handle(*args, **options)\r\n  File \"/usr/local/lib/python2.7/dist-packages/fias/management/commands/fias.py\", line 117, in handle\r\n    limit=limit, tables=tables, keep_indexes=keep_indexes\r\n  File \"/usr/local/lib/python2.7/dist-packages/fias/importer/commands.py\", line 89, in load_complete_data\r\n    restore_indexes_for_model(model=first_table.model)\r\n  File \"/usr/local/lib/python2.7/dist-packages/fias/importer/indexes.py\", line 64, in restore_indexes_for_model\r\n    change_indexes_for_model(model=model, field_from=simple_field, field_to=field)\r\n  File \"/usr/local/lib/python2.7/dist-packages/fias/importer/indexes.py\", line 54, in change_indexes_for_model\r\n    ed.alter_field(model, field_from, field_to)\r\n  File \"/usr/local/lib/python2.7/dist-packages/django/db/backends/base/schema.py\", line 482, in alter_field\r\n    old_db_params, new_db_params, strict)\r\n  File \"/usr/local/lib/python2.7/dist-packages/django/db/backends/base/schema.py\", line 663, in _alter_field\r\n    self.execute(self._create_unique_sql(model, [new_field.column]))\r\n  File \"/usr/local/lib/python2.7/dist-packages/django/db/backends/base/schema.py\", line 110, in execute\r\n    cursor.execute(sql, params)\r\n  File \"/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py\", line 64, in execute\r\n    return self.cursor.execute(sql, params)\r\n  File \"/usr/local/lib/python2.7/dist-packages/django/db/utils.py\", line 95, in __exit__\r\n    six.reraise(dj_exc_type, dj_exc_value, traceback)\r\n  File \"/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py\", line 64, in execute\r\n    return self.cursor.execute(sql, params)\r\n  File \"/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py\", line 112, in execute\r\n    return self.cursor.execute(query, args)\r\n  File \"/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py\", line 226, in execute\r\n    self.errorhandler(self, exc, value)\r\n  File \"/usr/lib/python2.7/dist-packages/MySQLdb/connections.py\", line 36, in defaulterrorhandler\r\n    raise errorvalue\r\ndjango.db.utils.IntegrityError: (1062, \"Duplicate entry '47aab24a73084c6c8756787b7172076a' for key 'fias_room_roomguid_f8e479d0_uniq'\")\r\n```"},"comment":{"url":"https://api.github.com/repos/Yuego/django-fias/issues/comments/249836926","html_url":"https://github.com/Yuego/django-fias/issues/61#issuecomment-249836926","issue_url":"https://api.github.com/repos/Yuego/django-fias/issues/61","id":249836926,"user":{"login":"Yuego","id":951586,"avatar_url":"https://avatars.githubusercontent.com/u/951586?v=3","gravatar_id":"","url":"https://api.github.com/users/Yuego","html_url":"https://github.com/Yuego","followers_url":"https://api.github.com/users/Yuego/followers","following_url":"https://api.github.com/users/Yuego/following{/other_user}","gists_url":"https://api.github.com/users/Yuego/gists{/gist_id}","starred_url":"https://api.github.com/users/Yuego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yuego/subscriptions","organizations_url":"https://api.github.com/users/Yuego/orgs","repos_url":"https://api.github.com/users/Yuego/repos","events_url":"https://api.github.com/users/Yuego/events{/privacy}","received_events_url":"https://api.github.com/users/Yuego/received_events","type":"User","site_admin":false},"created_at":"2016-09-27T11:18:55Z","updated_at":"2016-09-27T11:18:55Z","body":"> Правильно ли я понимаю, что коммит 83f3c0b решает проблему и без использования параметра --keep-indexes?\r\n\r\nДа, эту конкретную проблему должно решить.\r\n\r\n> Кстати, при наличии фильтра скорость что с индексами что без них примерно одинакова - около полутора суток.\r\n\r\nЭто уже зависит от железа. На моём тест показал огромную разницу в скорости. Особенно это заметно на таблице house. Чем больше размер уже импортированных данных - тем медленнее идет импорт с индексами."}}
{"actor":{"display_login":"Yuego"}}