summaryrefslogtreecommitdiff
path: root/django/core/management/commands/syncdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/core/management/commands/syncdb.py')
-rw-r--r--django/core/management/commands/syncdb.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/django/core/management/commands/syncdb.py b/django/core/management/commands/syncdb.py
index 6f1a198653..835e06f24a 100644
--- a/django/core/management/commands/syncdb.py
+++ b/django/core/management/commands/syncdb.py
@@ -77,10 +77,12 @@ class Command(NoArgsCommand):
)
# Create the tables for each model
+ if verbosity >= 1:
+ print "Creating tables ..."
for app_name, model_list in manifest.items():
for model in model_list:
# Create the model's database table, if it doesn't already exist.
- if verbosity >= 2:
+ if verbosity >= 3:
print "Processing %s.%s model" % (app_name, model._meta.object_name)
sql, references = connection.creation.sql_create_model(model, self.style, seen_models)
seen_models.add(model)
@@ -108,12 +110,14 @@ class Command(NoArgsCommand):
# Install custom SQL for the app (but only if this
# is a model we've just created)
+ if verbosity >= 1:
+ print "Installing custom SQL ..."
for app_name, model_list in manifest.items():
for model in model_list:
if model in created_models:
custom_sql = custom_sql_for_model(model, self.style, connection)
if custom_sql:
- if verbosity >= 1:
+ if verbosity >= 2:
print "Installing custom SQL for %s.%s model" % (app_name, model._meta.object_name)
try:
for sql in custom_sql:
@@ -128,16 +132,18 @@ class Command(NoArgsCommand):
else:
transaction.commit_unless_managed(using=db)
else:
- if verbosity >= 2:
+ if verbosity >= 3:
print "No custom SQL for %s.%s model" % (app_name, model._meta.object_name)
+ if verbosity >= 1:
+ print "Installing indexes ..."
# Install SQL indicies for all newly created models
for app_name, model_list in manifest.items():
for model in model_list:
if model in created_models:
index_sql = connection.creation.sql_indexes_for_model(model, self.style)
if index_sql:
- if verbosity >= 1:
+ if verbosity >= 2:
print "Installing index for %s.%s model" % (app_name, model._meta.object_name)
try:
for sql in index_sql: