Ticket #4528: pre_syncdb_sql_hook.patch
File pre_syncdb_sql_hook.patch, 818 bytes (added by , 17 years ago) |
---|
-
django/core/management.py
479 479 data_types = get_creation_module().DATA_TYPES 480 480 481 481 cursor = connection.cursor() 482 483 # Execute pre_syncdb sql. 484 try: 485 for statement in settings.DATABASE_PRE_SYNCDB: 486 try: 487 cursor.execute(statement) 488 except Exception, e: 489 sys.stderr.write("Failed to execute pre_syncdb sql for %s: %s\n" % \ 490 (app_name, statement)) 491 # Be silent if pre_syncdb is unset. 492 except AttributeError: 493 pass 482 494 483 495 # Get a list of all existing database tables, 484 496 # so we know what needs to be added.