Issue #3 resolved

GEO fixture doesn't imports in InnoDB tables

Maxim Syabro
created an issue

{{{

!python

D:\projects\bq>python manage.py loaddata vk-geo
Installing json fixture 'vk-geo' from 'D:\dev\Python26\lib\site-packages\vk_iframe\fixtures'.
Problem installing fixture 'D:\dev\Python26\lib\site-packages\vk_iframe\fixtures\vk-geo.json': Traceback (most recent call last):
File "D:\dev\Python26\lib\site-packages\django\core\management\commands\loaddata.py", line 169, in handle
obj.save(using=using)
File "D:\dev\Python26\lib\site-packages\django\core\serializers\base.py", line 165, in save
models.Model.save_base(self.object, using=using, raw=True)
File "D:\dev\Python26\lib\site-packages\django\db\models\base.py", line 528, in save_base
result = manager._insert(values, return_id=update_pk, using=using)
File "D:\dev\Python26\lib\site-packages\django\db\models\manager.py", line 195, in _insert
return insert_query(self.model, values, **kwargs)
File "D:\dev\Python26\lib\site-packages\django\db\models\query.py", line 1479, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "D:\dev\Python26\lib\site-packages\django\db\models\sql\compiler.py", line 783, in execute_sql
cursor = super(SQLInsertCompiler, self).execute_sql(None)
File "D:\dev\Python26\lib\site-packages\django\db\models\sql\compiler.py", line 727, in execute_sql
cursor.execute(sql, params)
File "D:\dev\Python26\lib\site-packages\django\db\backends\util.py", line 15, in execute
return self.cursor.execute(sql, params)
File "D:\dev\Python26\lib\site-packages\django\db\backends\mysql\base.py", line 86, in execute
return self.cursor.execute(query, args)
File "D:\dev\Python26\lib\site-packages\MySQLdb\cursors.py", line 173, in execute
self.errorhandler(self, exc, value)
File "D:\dev\Python26\lib\site-packages\MySQLdb\connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails (bq.vk_iframe_city, CONSTRAINT country_id_refs_id_43419e5d FOR EIGN KEY (country_id) REFERENCES vk_iframe_country (id))') }}}

You should swap countries and cities in fixture.

Comments (1)

  1. Log in to comment