Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1640 closed defect (fixed)

A little bit more for creating indexes automatically

Reported by: ned@… Owned by: Adrian Holovaty
Component: Core (Management commands) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I submitted ticket #1508 to create indexes when creating databases, but I missed one thing: the indexes on the core tables. This patch adds that as well.

--- site-packages/django/core/	(revision 3838)
+++ site-packages/django/core/	(revision 3839)
@@ -371,13 +371,13 @@
     "Initializes the database with auth and core."
         from django.core import db, meta
         auth = meta.get_app('auth')
         core = meta.get_app('core')
         cursor = db.db.cursor()
-        for sql in get_sql_create(core) + get_sql_create(auth) + get_sql_initial_data(core) + get_sql_initial_data(auth):
+        for sql in get_sql_create(core) + get_sql_create(auth) + get_sql_initial_data(core) + get_sql_initial_data(auth) + get_sql_indexes(core) + get_sql_indexes(auth):
         cursor.execute("INSERT INTO %s (%s, %s) VALUES ('', 'Example site')" % \
             (db.db.quote_name(core.Site._meta.db_table), db.db.quote_name('domain'),
     except Exception, e:
         sys.stderr.write("Error: The database couldn't be initialized.\n%s\n" % e)

Change History (1)

comment:1 Changed 13 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

No longer an issue with magic-removal merged.

Note: See TracTickets for help on using tickets.
Back to Top