sqldiff.rst 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. sqldiff
  2. =======
  3. :synopsis: Prints the ALTER TABLE statements for the given appnames.
  4. Django command that scans all models for the given appnames and compares
  5. their database schema with the real database tables.
  6. It indicates how columns in the database are different from the SQL that would
  7. be generated by Django. This command is not a database migration tool, though
  8. it might certainly be of help during migrations. Its purpose is to show the
  9. current differences as a way to check or debug your models compared to
  10. the real database tables and columns.
  11. Supported Databases
  12. -------------------
  13. Currently the following databases are supported:
  14. * PostgreSQL
  15. * Sqlite3
  16. * MySQL
  17. * Oracle
  18. Patches to support other databases are welcome! :-)
  19. Exit Codes
  20. ----------
  21. Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
  22. Example Usage
  23. -------------
  24. ::
  25. # View SQL differences for all installed applications
  26. $ ./manage.py sqldiff -a
  27. ::
  28. # View SQL differences for all installed applications using text instead of SQL
  29. $ ./manage.py sqldiff -a -t