mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49: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:
parent
1ad6a8f5c1
commit
557a0d407c
@ -178,7 +178,7 @@ def _get_sql_model_create(model, known_models=set()):
|
|||||||
rel_field = f
|
rel_field = f
|
||||||
data_type = f.get_internal_type()
|
data_type = f.get_internal_type()
|
||||||
col_type = data_types[data_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:
|
if col_type is not None:
|
||||||
# Make the definition (e.g. 'foo VARCHAR(30)') for this field.
|
# Make the definition (e.g. 'foo VARCHAR(30)') for this field.
|
||||||
field_output = [style.SQL_FIELD(backend.quote_name(f.column)),
|
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.
|
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(' %s%s' % (line, i < len(table_output)-1 and ',' or ''))
|
||||||
full_statement.append(')')
|
full_statement.append(')')
|
||||||
if opts.tablespace and backend.supports_tablespaces:
|
if opts.db_tablespace and backend.supports_tablespaces:
|
||||||
full_statement.append(backend.get_tablespace_sql(opts.tablespace))
|
full_statement.append(backend.get_tablespace_sql(opts.db_tablespace))
|
||||||
full_statement.append(';')
|
full_statement.append(';')
|
||||||
final_output.append('\n'.join(full_statement))
|
final_output.append('\n'.join(full_statement))
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ def _get_many_to_many_sql_for_model(model):
|
|||||||
final_output = []
|
final_output = []
|
||||||
for f in opts.many_to_many:
|
for f in opts.many_to_many:
|
||||||
if not isinstance(f.rel, GenericRel):
|
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:
|
if tablespace and backend.supports_tablespaces and backend.autoindexes_primary_keys:
|
||||||
tablespace_sql = ' ' + backend.get_tablespace_sql(tablespace, inline=True)
|
tablespace_sql = ' ' + backend.get_tablespace_sql(tablespace, inline=True)
|
||||||
else:
|
else:
|
||||||
@ -298,9 +298,9 @@ def _get_many_to_many_sql_for_model(model):
|
|||||||
style.SQL_FIELD(backend.quote_name(f.m2m_reverse_name())),
|
style.SQL_FIELD(backend.quote_name(f.m2m_reverse_name())),
|
||||||
tablespace_sql))
|
tablespace_sql))
|
||||||
table_output.append(')')
|
table_output.append(')')
|
||||||
if opts.tablespace and backend.supports_tablespaces:
|
if opts.db_tablespace and backend.supports_tablespaces:
|
||||||
# f.tablespace is only for indices, so ignore its value here.
|
# f.db_tablespace is only for indices, so ignore its value here.
|
||||||
table_output.append(backend.get_tablespace_sql(opts.tablespace))
|
table_output.append(backend.get_tablespace_sql(opts.db_tablespace))
|
||||||
table_output.append(';')
|
table_output.append(';')
|
||||||
final_output.append('\n'.join(table_output))
|
final_output.append('\n'.join(table_output))
|
||||||
|
|
||||||
@ -483,7 +483,7 @@ def get_sql_indexes_for_model(model):
|
|||||||
for f in model._meta.fields:
|
for f in model._meta.fields:
|
||||||
if f.db_index and not ((f.primary_key or f.unique) and backend.autoindexes_primary_keys):
|
if f.db_index and not ((f.primary_key or f.unique) and backend.autoindexes_primary_keys):
|
||||||
unique = f.unique and 'UNIQUE ' or ''
|
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:
|
if tablespace and backend.supports_tablespaces:
|
||||||
tablespace_sql = ' ' + backend.get_tablespace_sql(tablespace)
|
tablespace_sql = ' ' + backend.get_tablespace_sql(tablespace)
|
||||||
else:
|
else:
|
||||||
|
@ -70,7 +70,7 @@ class Field(object):
|
|||||||
core=False, rel=None, default=NOT_PROVIDED, editable=True, serialize=True,
|
core=False, rel=None, default=NOT_PROVIDED, editable=True, serialize=True,
|
||||||
prepopulate_from=None, unique_for_date=None, unique_for_month=None,
|
prepopulate_from=None, unique_for_date=None, unique_for_month=None,
|
||||||
unique_for_year=None, validator_list=None, choices=None, radio_admin=None,
|
unique_for_year=None, validator_list=None, choices=None, radio_admin=None,
|
||||||
help_text='', db_column=None, tablespace=None):
|
help_text='', db_column=None, db_tablespace=None):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.verbose_name = verbose_name
|
self.verbose_name = verbose_name
|
||||||
self.primary_key = primary_key
|
self.primary_key = primary_key
|
||||||
@ -87,7 +87,7 @@ class Field(object):
|
|||||||
self.radio_admin = radio_admin
|
self.radio_admin = radio_admin
|
||||||
self.help_text = help_text
|
self.help_text = help_text
|
||||||
self.db_column = db_column
|
self.db_column = db_column
|
||||||
self.tablespace = tablespace
|
self.db_tablespace = db_tablespace
|
||||||
|
|
||||||
# Set db_index to True if the field has a relationship and doesn't explicitly set db_index.
|
# Set db_index to True if the field has a relationship and doesn't explicitly set db_index.
|
||||||
self.db_index = db_index
|
self.db_index = db_index
|
||||||
|
@ -13,7 +13,7 @@ get_verbose_name = lambda class_name: re.sub('(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|
|
|||||||
|
|
||||||
DEFAULT_NAMES = ('verbose_name', 'db_table', 'ordering',
|
DEFAULT_NAMES = ('verbose_name', 'db_table', 'ordering',
|
||||||
'unique_together', 'permissions', 'get_latest_by',
|
'unique_together', 'permissions', 'get_latest_by',
|
||||||
'order_with_respect_to', 'app_label', 'tablespace')
|
'order_with_respect_to', 'app_label', 'db_tablespace')
|
||||||
|
|
||||||
class Options(object):
|
class Options(object):
|
||||||
def __init__(self, meta):
|
def __init__(self, meta):
|
||||||
@ -27,7 +27,7 @@ class Options(object):
|
|||||||
self.object_name, self.app_label = None, None
|
self.object_name, self.app_label = None, None
|
||||||
self.get_latest_by = None
|
self.get_latest_by = None
|
||||||
self.order_with_respect_to = None
|
self.order_with_respect_to = None
|
||||||
self.tablespace = None
|
self.db_tablespace = None
|
||||||
self.admin = None
|
self.admin = None
|
||||||
self.meta = meta
|
self.meta = meta
|
||||||
self.pk = None
|
self.pk = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user