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
c698c559
Kaydet (Commit)
c698c559
authored
Ock 07, 2013
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Created special PostgreSQL text indexes when unique is True
Refs #19441.
üst
a890469d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
creation.py
django/db/backends/postgresql_psycopg2/creation.py
+1
-1
fields.txt
docs/ref/models/fields.txt
+3
-0
models.py
tests/regressiontests/indexes/models.py
+1
-1
No files found.
django/db/backends/postgresql_psycopg2/creation.py
Dosyayı görüntüle @
c698c559
...
...
@@ -42,7 +42,7 @@ class DatabaseCreation(BaseDatabaseCreation):
def
sql_indexes_for_field
(
self
,
model
,
f
,
style
):
output
=
[]
if
f
.
db_index
:
if
f
.
db_index
or
f
.
unique
:
qn
=
self
.
connection
.
ops
.
quote_name
db_table
=
model
.
_meta
.
db_table
tablespace
=
f
.
db_tablespace
or
model
.
_meta
.
db_tablespace
...
...
docs/ref/models/fields.txt
Dosyayı görüntüle @
c698c559
...
...
@@ -272,6 +272,9 @@ field, a :exc:`django.db.IntegrityError` will be raised by the model's
This option is valid on all field types except :class:`ManyToManyField` and
:class:`FileField`.
Note that when ``unique`` is ``True``, you don't need to specify
:attr:`~Field.db_index`, because ``unique`` implies the creation of an index.
``unique_for_date``
-------------------
...
...
tests/regressiontests/indexes/models.py
Dosyayı görüntüle @
c698c559
...
...
@@ -17,4 +17,4 @@ if connection.vendor == 'postgresql':
class
IndexedArticle
(
models
.
Model
):
headline
=
models
.
CharField
(
max_length
=
100
,
db_index
=
True
)
body
=
models
.
TextField
(
db_index
=
True
)
slug
=
models
.
CharField
(
max_length
=
40
,
unique
=
True
,
db_index
=
True
)
slug
=
models
.
CharField
(
max_length
=
40
,
unique
=
True
)
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