mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
boulder-oracle-sprint: Call each backend for its version of "BEGIN;" to start
a transaction. Previously, Oracle saw the output of "./manage.py sqlall" as starting a PL/SQL function definition. git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4758 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
815837c8af
commit
c62feba2a3
@ -1542,6 +1542,8 @@ def print_error(msg, cmd):
|
||||
sys.exit(1)
|
||||
|
||||
def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING, argv=None):
|
||||
from django.db import backend
|
||||
|
||||
# Use sys.argv if we've not passed in a custom argv
|
||||
if argv is None:
|
||||
argv = sys.argv
|
||||
@ -1652,7 +1654,7 @@ def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING, argv=None):
|
||||
if not mod_list:
|
||||
parser.print_usage_and_exit()
|
||||
if action not in NO_SQL_TRANSACTION:
|
||||
print style.SQL_KEYWORD("BEGIN;")
|
||||
print style.SQL_KEYWORD(backend.get_start_transaction_sql())
|
||||
for mod in mod_list:
|
||||
if action == 'reset':
|
||||
output = action_mapping[action](mod, options.interactive)
|
||||
|
@ -149,6 +149,9 @@ def get_pk_default_value():
|
||||
def get_max_name_length():
|
||||
return None
|
||||
|
||||
def get_start_transaction_sql():
|
||||
return "BEGIN;"
|
||||
|
||||
def get_autoinc_sql(table):
|
||||
return None
|
||||
|
||||
|
@ -194,6 +194,9 @@ def get_pk_default_value():
|
||||
def get_max_name_length():
|
||||
return 64;
|
||||
|
||||
def get_start_transaction_sql():
|
||||
return "BEGIN;"
|
||||
|
||||
def get_autoinc_sql(table):
|
||||
return None
|
||||
|
||||
|
@ -168,6 +168,9 @@ def get_pk_default_value():
|
||||
def get_max_name_length():
|
||||
return 30
|
||||
|
||||
def get_start_transaction_sql():
|
||||
return ""
|
||||
|
||||
def get_autoinc_sql(table):
|
||||
# To simulate auto-incrementing primary keys in Oracle, we have to
|
||||
# create a sequence and a trigger.
|
||||
|
@ -169,6 +169,9 @@ def get_pk_default_value():
|
||||
def get_max_name_length():
|
||||
return None
|
||||
|
||||
def get_start_transaction_sql():
|
||||
return "BEGIN;"
|
||||
|
||||
def get_autoinc_sql(table):
|
||||
return None
|
||||
|
||||
|
@ -129,6 +129,9 @@ def get_pk_default_value():
|
||||
def get_max_name_length():
|
||||
return None
|
||||
|
||||
def get_start_transaction_sql():
|
||||
return "BEGIN;"
|
||||
|
||||
def get_autoinc_sql(table):
|
||||
return None
|
||||
|
||||
|
@ -163,6 +163,9 @@ def get_pk_default_value():
|
||||
def get_max_name_length():
|
||||
return None
|
||||
|
||||
def get_start_transaction_sql():
|
||||
return "BEGIN;"
|
||||
|
||||
def get_autoinc_sql(table):
|
||||
return None
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user