0
0
mirror of https://github.com/django/django.git synced 2024-11-24 20:07:01 +01:00

adjust order in more places

This commit is contained in:
Ben Cail 2024-10-15 15:14:31 -04:00
parent e77b7bb4b1
commit 2166f4b077

View File

@ -366,8 +366,8 @@ class BaseDatabaseSchemaEditor:
# Optionally add the tablespace if it's an implicitly indexed column. # Optionally add the tablespace if it's an implicitly indexed column.
tablespace = ( tablespace = (
field.db_tablespace field.db_tablespace
or settings.DATABASES[self.connection.alias].get("DEFAULT_TABLESPACE")
or model._meta.db_tablespace or model._meta.db_tablespace
or settings.DATABASES[self.connection.alias].get("DEFAULT_TABLESPACE")
) )
if ( if (
tablespace tablespace
@ -1533,10 +1533,10 @@ class BaseDatabaseSchemaEditor:
db_tablespace = db_settings["DEFAULT_INDEX_TABLESPACE"] db_tablespace = db_settings["DEFAULT_INDEX_TABLESPACE"]
elif settings.DEFAULT_INDEX_TABLESPACE: elif settings.DEFAULT_INDEX_TABLESPACE:
db_tablespace = settings.DEFAULT_INDEX_TABLESPACE db_tablespace = settings.DEFAULT_INDEX_TABLESPACE
elif db_settings.get("DEFAULT_TABLESPACE"):
db_tablespace = db_settings["DEFAULT_TABLESPACE"]
elif model._meta.db_tablespace: elif model._meta.db_tablespace:
db_tablespace = model._meta.db_tablespace db_tablespace = model._meta.db_tablespace
elif db_settings.get("DEFAULT_TABLESPACE"):
db_tablespace = db_settings["DEFAULT_TABLESPACE"]
if db_tablespace is not None: if db_tablespace is not None:
return " " + self.connection.ops.tablespace_sql(db_tablespace) return " " + self.connection.ops.tablespace_sql(db_tablespace)
return "" return ""