SQL commands generated in Django by running sqlall
Posted
by k-g-f
on Stack Overflow
See other posts from Stack Overflow
or by k-g-f
Published on 2010-06-16T18:15:57Z
Indexed on
2010/06/16
18:22 UTC
Read the original article
Hit count: 155
django
|django-models
In my Django app, I just ran
$ python manage.py sqlall
and I see a lot of SQL statements that look like this, when describing FK relationships:
ALTER TABLE `app1_model1` ADD CONSTRAINT model2_id_refs_id_728de91f FOREIGN KEY (`model2_id`) REFERENCES `app1_model2` (`id`);
Where does "7218de91f" come from? I would like to know because I'd like to manually write SQL statements to accompany models changes in the app so that my db's can be kept up to date.
© Stack Overflow or respective owner