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
e5b8626c
Kaydet (Commit)
e5b8626c
authored
Ara 21, 2018
tarafından
Simon Charette
Kaydeden (comit)
Tim Graham
Ara 22, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #29547 -- Corrected SQLite's supports_partial_indexes feature flag.
üst
c5b58d77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
features.py
django/db/backends/sqlite3/features.py
+1
-1
tests.py
tests/indexes/tests.py
+10
-1
No files found.
django/db/backends/sqlite3/features.py
Dosyayı görüntüle @
e5b8626c
...
@@ -34,7 +34,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
...
@@ -34,7 +34,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_cast_with_precision
=
False
supports_cast_with_precision
=
False
time_cast_precision
=
3
time_cast_precision
=
3
can_release_savepoints
=
True
can_release_savepoints
=
True
supports_partial_indexes
=
Database
.
version_info
>=
(
3
,
8
,
0
)
supports_partial_indexes
=
Database
.
sqlite_
version_info
>=
(
3
,
8
,
0
)
# Is "ALTER TABLE ... RENAME COLUMN" supported?
# Is "ALTER TABLE ... RENAME COLUMN" supported?
can_alter_table_rename_column
=
Database
.
sqlite_version_info
>=
(
3
,
25
,
0
)
can_alter_table_rename_column
=
Database
.
sqlite_version_info
>=
(
3
,
25
,
0
)
supports_parentheses_in_compound
=
False
supports_parentheses_in_compound
=
False
...
...
tests/indexes/tests.py
Dosyayı görüntüle @
e5b8626c
...
@@ -9,6 +9,7 @@ from django.db.models.query_utils import Q
...
@@ -9,6 +9,7 @@ from django.db.models.query_utils import Q
from
django.test
import
(
from
django.test
import
(
TestCase
,
TransactionTestCase
,
skipIfDBFeature
,
skipUnlessDBFeature
,
TestCase
,
TransactionTestCase
,
skipIfDBFeature
,
skipUnlessDBFeature
,
)
)
from
django.test.utils
import
override_settings
from
django.utils
import
timezone
from
django.utils
import
timezone
from
.models
import
(
from
.models
import
(
...
@@ -237,8 +238,11 @@ class SchemaIndexesMySQLTests(TransactionTestCase):
...
@@ -237,8 +238,11 @@ class SchemaIndexesMySQLTests(TransactionTestCase):
@skipUnlessDBFeature
(
'supports_partial_indexes'
)
@skipUnlessDBFeature
(
'supports_partial_indexes'
)
class
PartialIndexTests
(
TestCase
):
# SQLite doesn't support timezone-aware datetimes when USE_TZ is False.
@override_settings
(
USE_TZ
=
True
)
class
PartialIndexTests
(
TransactionTestCase
):
# Schema editor is used to create the index to test that it works.
# Schema editor is used to create the index to test that it works.
available_apps
=
[
'indexes'
]
def
test_partial_index
(
self
):
def
test_partial_index
(
self
):
with
connection
.
schema_editor
()
as
editor
:
with
connection
.
schema_editor
()
as
editor
:
...
@@ -263,6 +267,7 @@ class PartialIndexTests(TestCase):
...
@@ -263,6 +267,7 @@ class PartialIndexTests(TestCase):
self
.
assertIn
(
index
.
name
,
connection
.
introspection
.
get_constraints
(
self
.
assertIn
(
index
.
name
,
connection
.
introspection
.
get_constraints
(
cursor
=
connection
.
cursor
(),
table_name
=
Article
.
_meta
.
db_table
,
cursor
=
connection
.
cursor
(),
table_name
=
Article
.
_meta
.
db_table
,
))
))
editor
.
remove_index
(
index
=
index
,
model
=
Article
)
def
test_integer_restriction_partial
(
self
):
def
test_integer_restriction_partial
(
self
):
with
connection
.
schema_editor
()
as
editor
:
with
connection
.
schema_editor
()
as
editor
:
...
@@ -279,6 +284,7 @@ class PartialIndexTests(TestCase):
...
@@ -279,6 +284,7 @@ class PartialIndexTests(TestCase):
self
.
assertIn
(
index
.
name
,
connection
.
introspection
.
get_constraints
(
self
.
assertIn
(
index
.
name
,
connection
.
introspection
.
get_constraints
(
cursor
=
connection
.
cursor
(),
table_name
=
Article
.
_meta
.
db_table
,
cursor
=
connection
.
cursor
(),
table_name
=
Article
.
_meta
.
db_table
,
))
))
editor
.
remove_index
(
index
=
index
,
model
=
Article
)
def
test_boolean_restriction_partial
(
self
):
def
test_boolean_restriction_partial
(
self
):
with
connection
.
schema_editor
()
as
editor
:
with
connection
.
schema_editor
()
as
editor
:
...
@@ -295,6 +301,7 @@ class PartialIndexTests(TestCase):
...
@@ -295,6 +301,7 @@ class PartialIndexTests(TestCase):
self
.
assertIn
(
index
.
name
,
connection
.
introspection
.
get_constraints
(
self
.
assertIn
(
index
.
name
,
connection
.
introspection
.
get_constraints
(
cursor
=
connection
.
cursor
(),
table_name
=
Article
.
_meta
.
db_table
,
cursor
=
connection
.
cursor
(),
table_name
=
Article
.
_meta
.
db_table
,
))
))
editor
.
remove_index
(
index
=
index
,
model
=
Article
)
def
test_multiple_conditions
(
self
):
def
test_multiple_conditions
(
self
):
with
connection
.
schema_editor
()
as
editor
:
with
connection
.
schema_editor
()
as
editor
:
...
@@ -323,6 +330,7 @@ class PartialIndexTests(TestCase):
...
@@ -323,6 +330,7 @@ class PartialIndexTests(TestCase):
self
.
assertIn
(
index
.
name
,
connection
.
introspection
.
get_constraints
(
self
.
assertIn
(
index
.
name
,
connection
.
introspection
.
get_constraints
(
cursor
=
connection
.
cursor
(),
table_name
=
Article
.
_meta
.
db_table
,
cursor
=
connection
.
cursor
(),
table_name
=
Article
.
_meta
.
db_table
,
))
))
editor
.
remove_index
(
index
=
index
,
model
=
Article
)
def
test_is_null_condition
(
self
):
def
test_is_null_condition
(
self
):
with
connection
.
schema_editor
()
as
editor
:
with
connection
.
schema_editor
()
as
editor
:
...
@@ -339,3 +347,4 @@ class PartialIndexTests(TestCase):
...
@@ -339,3 +347,4 @@ class PartialIndexTests(TestCase):
self
.
assertIn
(
index
.
name
,
connection
.
introspection
.
get_constraints
(
self
.
assertIn
(
index
.
name
,
connection
.
introspection
.
get_constraints
(
cursor
=
connection
.
cursor
(),
table_name
=
Article
.
_meta
.
db_table
,
cursor
=
connection
.
cursor
(),
table_name
=
Article
.
_meta
.
db_table
,
))
))
editor
.
remove_index
(
index
=
index
,
model
=
Article
)
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