tulsawebdevs / django-multi-gtfs

Django app to import and export General Transit Feed Specification (GTFS)
http://tulsawebdevs.org/
Apache License 2.0
50 stars 32 forks source link

do not override db_table #55

Open davekaro opened 7 years ago

davekaro commented 7 years ago

Can you explain the reasoning for why db_table is being overridden in all the models instead of using the default of app_label + model name?

jwhitlock commented 7 years ago

When the models were moved from models.py to a models folder, Django wanted to change the names from multigtfs_feed to models_feed. With the addition of app_label, this may have changed to multigtfs_models_feed, and db_table was needed to keep the existing table names.

It is possible this was fixed in later Django versions (https://code.djangoproject.com/ticket/3591 was closed 3 years ago), and explicitly setting db_table is now unneeded. The experiment would be to remove it and see what ./manage.py makemigrations multigtfs does.

davekaro commented 7 years ago

Ah very interesting thanks for the explanation. If I give that a try - would you want a PR for that?

jwhitlock commented 7 years ago

yes, I'll review the PR.