diff options
| author | Claude Paroz <claude@2xlibre.net> | 2013-05-29 15:47:21 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2013-05-29 15:50:26 +0200 |
| commit | 8010289ea2f30f0bb819feba7ec78e67c198023b (patch) | |
| tree | 46d262126e17856729de9244628b4dfd7f82c2a2 /django | |
| parent | 5939864616d56cf949f0bca348a8e05230b62fe0 (diff) | |
Fixed #15697 -- Made sqlindexes aware of auto-created tables
Thanks mbertheau for the report and Ash Christopher for the
initial patch.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/sql.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/management/sql.py b/django/core/management/sql.py index 27ada10248..42ccafa2c5 100644 --- a/django/core/management/sql.py +++ b/django/core/management/sql.py @@ -133,7 +133,7 @@ def sql_custom(app, style, connection): def sql_indexes(app, style, connection): "Returns a list of the CREATE INDEX SQL statements for all models in the given app." output = [] - for model in models.get_models(app): + for model in models.get_models(app, include_auto_created=True): output.extend(connection.creation.sql_indexes_for_model(model, style)) return output @@ -141,7 +141,7 @@ def sql_indexes(app, style, connection): def sql_destroy_indexes(app, style, connection): "Returns a list of the DROP INDEX SQL statements for all models in the given app." output = [] - for model in models.get_models(app): + for model in models.get_models(app, include_auto_created=True): output.extend(connection.creation.sql_destroy_indexes_for_model(model, style)) return output |
