Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
9c4ad454
Kaydet (Commit)
9c4ad454
authored
Şub 09, 2014
tarafından
Andrew Godwin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #21842: Remove redundant DatabaseFeatures.max_index_name_length
üst
d5df7a05
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
8 deletions
+5
-8
__init__.py
django/db/backends/__init__.py
+0
-3
base.py
django/db/backends/oracle/base.py
+0
-1
schema.py
django/db/backends/schema.py
+5
-4
No files found.
django/db/backends/__init__.py
Dosyayı görüntüle @
9c4ad454
...
...
@@ -654,9 +654,6 @@ class BaseDatabaseFeatures(object):
# Can we issue more than one ALTER COLUMN clause in an ALTER TABLE?
supports_combined_alters
=
False
# What's the maximum length for index names?
max_index_name_length
=
63
# Does it support foreign keys?
supports_foreign_keys
=
True
...
...
django/db/backends/oracle/base.py
Dosyayı görüntüle @
9c4ad454
...
...
@@ -99,7 +99,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_sequence_reset
=
False
atomic_transactions
=
False
supports_combined_alters
=
False
max_index_name_length
=
30
nulls_order_largest
=
True
requires_literal_defaults
=
True
connection_persists_old_columns
=
True
...
...
django/db/backends/schema.py
Dosyayı görüntüle @
9c4ad454
...
...
@@ -769,17 +769,18 @@ class BaseDatabaseSchemaEditor(object):
# Else generate the name for the index using a different algorithm
table_name
=
model
.
_meta
.
db_table
.
replace
(
'"'
,
''
)
.
replace
(
'.'
,
'_'
)
index_unique_name
=
'_
%
x'
%
abs
(
hash
((
table_name
,
','
.
join
(
column_names
))))
max_length
=
self
.
connection
.
ops
.
max_name_length
()
or
200
# If the index name is too long, truncate it
index_name
=
(
'
%
s_
%
s
%
s
%
s'
%
(
table_name
,
column_names
[
0
],
index_unique_name
,
suffix
))
.
replace
(
'"'
,
''
)
.
replace
(
'.'
,
'_'
)
if
len
(
index_name
)
>
self
.
connection
.
features
.
max_index_name
_length
:
if
len
(
index_name
)
>
max
_length
:
part
=
(
'_
%
s
%
s
%
s'
%
(
column_names
[
0
],
index_unique_name
,
suffix
))
index_name
=
'
%
s
%
s'
%
(
table_name
[:(
self
.
connection
.
features
.
max_index_name
_length
-
len
(
part
))],
part
)
index_name
=
'
%
s
%
s'
%
(
table_name
[:(
max
_length
-
len
(
part
))],
part
)
# It shouldn't start with an underscore (Oracle hates this)
if
index_name
[
0
]
==
"_"
:
index_name
=
index_name
[
1
:]
# If it's STILL too long, just hash it down
if
len
(
index_name
)
>
self
.
connection
.
features
.
max_index_name
_length
:
index_name
=
hashlib
.
md5
(
force_bytes
(
index_name
))
.
hexdigest
()[:
self
.
connection
.
features
.
max_index_name
_length
]
if
len
(
index_name
)
>
max
_length
:
index_name
=
hashlib
.
md5
(
force_bytes
(
index_name
))
.
hexdigest
()[:
max
_length
]
# It can't start with a number on Oracle, so prepend D if we need to
if
index_name
[
0
]
.
isdigit
():
index_name
=
"D
%
s"
%
index_name
[:
-
1
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment