1
0
mirror of https://github.com/django/django.git synced 2025-10-28 16:16:12 +00:00

boulder-oracle-sprint: Renamed the "tablespace" options to "db_tablespace".

git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5036 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Boulder Sprinters
2007-04-19 21:17:29 +00:00
parent 1ad6a8f5c1
commit 557a0d407c
3 changed files with 12 additions and 12 deletions

View File

@@ -178,7 +178,7 @@ def _get_sql_model_create(model, known_models=set()):
rel_field = f
data_type = f.get_internal_type()
col_type = data_types[data_type]
tablespace = f.tablespace or opts.tablespace
tablespace = f.db_tablespace or opts.db_tablespace
if col_type is not None:
# Make the definition (e.g. 'foo VARCHAR(30)') for this field.
field_output = [style.SQL_FIELD(backend.quote_name(f.column)),
@@ -216,8 +216,8 @@ def _get_sql_model_create(model, known_models=set()):
for i, line in enumerate(table_output): # Combine and add commas.
full_statement.append(' %s%s' % (line, i < len(table_output)-1 and ',' or ''))
full_statement.append(')')
if opts.tablespace and backend.supports_tablespaces:
full_statement.append(backend.get_tablespace_sql(opts.tablespace))
if opts.db_tablespace and backend.supports_tablespaces:
full_statement.append(backend.get_tablespace_sql(opts.db_tablespace))
full_statement.append(';')
final_output.append('\n'.join(full_statement))
@@ -266,7 +266,7 @@ def _get_many_to_many_sql_for_model(model):
final_output = []
for f in opts.many_to_many:
if not isinstance(f.rel, GenericRel):
tablespace = f.tablespace or opts.tablespace
tablespace = f.db_tablespace or opts.db_tablespace
if tablespace and backend.supports_tablespaces and backend.autoindexes_primary_keys:
tablespace_sql = ' ' + backend.get_tablespace_sql(tablespace, inline=True)
else:
@@ -298,9 +298,9 @@ def _get_many_to_many_sql_for_model(model):
style.SQL_FIELD(backend.quote_name(f.m2m_reverse_name())),
tablespace_sql))
table_output.append(')')
if opts.tablespace and backend.supports_tablespaces:
# f.tablespace is only for indices, so ignore its value here.
table_output.append(backend.get_tablespace_sql(opts.tablespace))
if opts.db_tablespace and backend.supports_tablespaces:
# f.db_tablespace is only for indices, so ignore its value here.
table_output.append(backend.get_tablespace_sql(opts.db_tablespace))
table_output.append(';')
final_output.append('\n'.join(table_output))
@@ -483,7 +483,7 @@ def get_sql_indexes_for_model(model):
for f in model._meta.fields:
if f.db_index and not ((f.primary_key or f.unique) and backend.autoindexes_primary_keys):
unique = f.unique and 'UNIQUE ' or ''
tablespace = f.tablespace or model._meta.tablespace
tablespace = f.db_tablespace or model._meta.db_tablespace
if tablespace and backend.supports_tablespaces:
tablespace_sql = ' ' + backend.get_tablespace_sql(tablespace)
else: