Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1640 closed defect (fixed)

A little bit more for creating indexes automatically

Reported by: ned@… Owned by: adrian
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: UI/UX:

Description

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/management.py	(revision 3838)
+++ site-packages/django/core/management.py	(revision 3839)
@@ -371,13 +371,13 @@
     "Initializes the database with auth and core."
     try:
         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(sql)
         cursor.execute("INSERT INTO %s (%s, %s) VALUES ('example.com', 'Example site')" % \
             (db.db.quote_name(core.Site._meta.db_table), db.db.quote_name('domain'),
             db.db.quote_name('name')))
     except Exception, e:
         sys.stderr.write("Error: The database couldn't be initialized.\n%s\n" % e)

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

No longer an issue with magic-removal merged.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.