Reputation: 5222
So I have my Django app running and I just added South. I performed some migrations which worked fine locally, but I am seeing some database errors on my Heroku version. I'd like to view the current schema for my database both locally and on Heroku so I can compare and see exactly what is different. Is there an easy way to do this from the command line, or a better way to debug this?
Upvotes: 2
Views: 4413
Reputation: 166
django also provides a management command that will display the sql for any app you have configure in your project, regardless of the database manager (SQLite, MySQL, etc) that you're using:
python manage.py sqlall <app name>
Try it! It could be usefull!
Upvotes: 0
Reputation: 37507
From the command line you should be able to do heroku pg:psql
to connect directly via PSQL to your database and from in there \dt
will show you your tables and \d <tablename>
will show you your table schema.
Upvotes: 3
Reputation: 55962
locally django provides a management command that will launch you into your db's shell.
python manage.py dbshell
Upvotes: 2