diefenbach / django-lfs

An online-shop based on Django
http://www.getlfs.com
BSD 3-Clause "New" or "Revised" License
622 stars 222 forks source link

fixes delete_column bugs in lfs_migrate.py #90

Closed baffolobill closed 11 years ago

baffolobill commented 11 years ago

django.db.utils.DatabaseError: (1091, "Can't DROP 'invoice_country'; check that column/key exists")

pigletto commented 11 years ago

Which database do you use? I'm pretty sure that it worked with sqlite but might be that it fails with 'real' dbms.

baffolobill commented 11 years ago

MySQL == 5.1.68 South == 0.7.6

baffolobill commented 11 years ago

It should work properly under normal conditions, but I'm not sure. South grabs all constraints for MySQL from the information_schema database. In my case there is no data about a "FOREIGN KEY" for the table "order_order", so it tries to delete *_country instead of *_country_id. I think it's safer to explicity specify the field names rather than rely on the South.

baffolobill commented 11 years ago

Perhaps everyone who uses MyISAM storage will face this problem.

diefenbach commented 11 years ago

I can reproduce this for other databases as well. I have also some other issues, which I will fix subsequently.