Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get './manage.py syncdb' to create additional views or run custom SQL?

Is there a way to run some custom SQL statements after syncdb does it thing creating the tables for the models? Specifically, I would like to create some database views.

like image 954
Ricky Avatar asked Mar 04 '09 16:03

Ricky


1 Answers

Yes, there are signals you can catch after a syncdb.

See management signals for docs.

This is how the contrib.auth permissions table is populated, as well as the contenttypes framework table.

like image 64
Van Gale Avatar answered Oct 17 '22 12:10

Van Gale