Add new utilities for working with databases and models.
Review Request #10562 — Created May 22, 2019 and submitted — Latest diff uploaded
sql_create(), a utility function for generating the SQL for creating
an app's models, has been renamed to
sql_create_app(), and its
model-creating functionality split out into
allows callers to generate suitable SQL for creating only a subset of
models for an app, or several models for several apps.
db_router_allows_schema_upgrade()is a new wrapper around
simplifying the work required by a caller.
db_get_installable_models_for_app()returns all models that can be
installed in the database (using
operation). It takes care of returning models suitable for the preferred
creation mechanism used on the running version of Django, and handles
checking the router using the new
Unit tests pass on Django 1.6 and 1.11.