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
44927ba8
Kaydet (Commit)
44927ba8
authored
Ara 11, 2014
tarafından
Markus Holtermann
Kaydeden (comit)
Tim Graham
Ara 11, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23956 -- Fixed migration creation for multiple table inheritance
üst
38fc463f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
autodetector.py
django/db/migrations/autodetector.py
+1
-1
1.7.2.txt
docs/releases/1.7.2.txt
+4
-0
test_autodetector.py
tests/migrations/test_autodetector.py
+23
-0
No files found.
django/db/migrations/autodetector.py
Dosyayı görüntüle @
44927ba8
...
...
@@ -463,7 +463,7 @@ class MigrationAutodetector(object):
if
field
.
rel
.
to
:
if
field
.
primary_key
:
primary_key_rel
=
field
.
rel
.
to
el
se
:
el
if
not
field
.
rel
.
parent_link
:
related_fields
[
field
.
name
]
=
field
# through will be none on M2Ms on swapped-out models;
# we can treat lack of through as auto_created=True, though.
...
...
docs/releases/1.7.2.txt
Dosyayı görüntüle @
44927ba8
...
...
@@ -115,3 +115,7 @@ Bugfixes
* Fixed index creation by the migration infrastructure, particularly when
dealing with PostgreSQL specific {text|varchar}_pattern_ops indexes
(:ticket:`23954`).
* Fixed bug in ``makemigrations`` that created broken migration files when
dealing with multiple table inheritance and inheriting from more than one
model (:ticket:`23956`).
tests/migrations/test_autodetector.py
Dosyayı görüntüle @
44927ba8
...
...
@@ -1446,6 +1446,29 @@ class AutodetectorTests(TestCase):
self
.
assertOperationAttributes
(
changes
,
'testapp'
,
0
,
0
,
name
=
"Author"
)
self
.
assertOperationAttributes
(
changes
,
'testapp'
,
0
,
1
,
name
=
"Aardvark"
)
def
test_multiple_bases
(
self
):
"""#23956 - Tests that inheriting models doesn't move *_ptr fields into AddField operations."""
A
=
ModelState
(
"app"
,
"A"
,
[(
"a_id"
,
models
.
AutoField
(
primary_key
=
True
))])
B
=
ModelState
(
"app"
,
"B"
,
[(
"b_id"
,
models
.
AutoField
(
primary_key
=
True
))])
C
=
ModelState
(
"app"
,
"C"
,
[],
bases
=
(
"app.A"
,
"app.B"
))
D
=
ModelState
(
"app"
,
"D"
,
[],
bases
=
(
"app.A"
,
"app.B"
))
E
=
ModelState
(
"app"
,
"E"
,
[],
bases
=
(
"app.A"
,
"app.B"
))
# Make state
before
=
self
.
make_project_state
([])
after
=
self
.
make_project_state
([
A
,
B
,
C
,
D
,
E
])
autodetector
=
MigrationAutodetector
(
before
,
after
)
changes
=
autodetector
.
_detect_changes
()
# Right number/type of migrations?
self
.
assertNumberMigrations
(
changes
,
"app"
,
1
)
self
.
assertOperationTypes
(
changes
,
"app"
,
0
,
[
"CreateModel"
,
"CreateModel"
,
"CreateModel"
,
"CreateModel"
,
"CreateModel"
])
self
.
assertOperationAttributes
(
changes
,
"app"
,
0
,
0
,
name
=
"A"
)
self
.
assertOperationAttributes
(
changes
,
"app"
,
0
,
1
,
name
=
"B"
)
self
.
assertOperationAttributes
(
changes
,
"app"
,
0
,
2
,
name
=
"C"
)
self
.
assertOperationAttributes
(
changes
,
"app"
,
0
,
3
,
name
=
"D"
)
self
.
assertOperationAttributes
(
changes
,
"app"
,
0
,
4
,
name
=
"E"
)
def
test_proxy_bases_first
(
self
):
"""Tests that bases of proxies come first."""
# Make state
...
...
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