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
4d420a53
Kaydet (Commit)
4d420a53
authored
Mar 09, 2018
tarafından
Carlton Gibson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #29180 -- Added MigrationGraph._generate_plan() for testing.
üst
2d9ec4d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
graph.py
django/db/migrations/graph.py
+9
-5
No files found.
django/db/migrations/graph.py
Dosyayı görüntüle @
4d420a53
...
...
@@ -352,6 +352,14 @@ class MigrationGraph:
def
_nodes_and_edges
(
self
):
return
len
(
self
.
nodes
),
sum
(
len
(
node
.
parents
)
for
node
in
self
.
node_map
.
values
())
def
_generate_plan
(
self
,
nodes
,
at_end
):
plan
=
[]
for
node
in
nodes
:
for
migration
in
self
.
forwards_plan
(
node
):
if
migration
in
plan
or
at_end
or
migration
not
in
nodes
:
plan
.
append
(
migration
)
return
plan
def
make_state
(
self
,
nodes
=
None
,
at_end
=
True
,
real_apps
=
None
):
"""
Given a migration node or nodes, return a complete ProjectState for it.
...
...
@@ -364,11 +372,7 @@ class MigrationGraph:
return
ProjectState
()
if
not
isinstance
(
nodes
[
0
],
tuple
):
nodes
=
[
nodes
]
plan
=
[]
for
node
in
nodes
:
for
migration
in
self
.
forwards_plan
(
node
):
if
migration
in
plan
or
at_end
or
migration
not
in
nodes
:
plan
.
append
(
migration
)
plan
=
self
.
_generate_plan
(
nodes
,
at_end
)
project_state
=
ProjectState
(
real_apps
=
real_apps
)
for
node
in
plan
:
project_state
=
self
.
nodes
[
node
]
.
mutate_state
(
project_state
,
preserve
=
False
)
...
...
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