Задать вопрос

Тел: +7 965 3737 888

465

Просмотров

0

Ответов

Database cleanup

<p><strong><em>About</em></strong>
</p>
<p>I tried to dump data from my database (manage.py dumpdata) and I couldn't do it because of error:
</p>
User matching query does not exists
<p>I found out that my database was filled with garbage: entries those foreigners were deleted. My table's engine is MyISAM so it allows for these lost entries to exist. I had to cleanup my database before I do datadump, so I've written a script which worked fine for me.
</p>
<p><strong><em>Usage</em></strong>
</p>
<p>Place this script in same directory with your settings.py and run it: python db_cleanup.py
</p>
<p><strong><em>Disclaimer</em></strong>
</p>
<p>Backup your data :)
</p>

Вопрос полезен? Да0/Нет0
file_2716.py(1.4Кб)
None