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
beefac8a
Kaydet (Commit)
beefac8a
authored
Agu 21, 2013
tarafından
Andrew Godwin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Only create the migration directory once per app
üst
2d903929
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
makemigrations.py
django/core/management/commands/makemigrations.py
+9
-5
No files found.
django/core/management/commands/makemigrations.py
Dosyayı görüntüle @
beefac8a
...
...
@@ -61,6 +61,7 @@ class Command(BaseCommand):
self
.
stdout
.
write
(
"No changes detected"
)
return
directory_created
=
{}
for
app_label
,
migrations
in
changes
.
items
():
self
.
stdout
.
write
(
self
.
style
.
MIGRATE_HEADING
(
"Migrations for '
%
s':"
%
app_label
)
+
"
\n
"
)
for
migration
in
migrations
:
...
...
@@ -71,10 +72,13 @@ class Command(BaseCommand):
self
.
stdout
.
write
(
" -
%
s
\n
"
%
operation
.
describe
())
# Write it
migrations_directory
=
os
.
path
.
dirname
(
writer
.
path
)
if
not
os
.
path
.
isdir
(
migrations_directory
):
os
.
mkdir
(
migrations_directory
)
init_path
=
os
.
path
.
join
(
migrations_directory
,
"__init__.py"
)
if
not
os
.
path
.
isfile
(
init_path
):
open
(
init_path
,
"w"
)
.
close
()
if
not
directory_created
.
get
(
app_label
,
False
):
if
not
os
.
path
.
isdir
(
migrations_directory
):
os
.
mkdir
(
migrations_directory
)
init_path
=
os
.
path
.
join
(
migrations_directory
,
"__init__.py"
)
if
not
os
.
path
.
isfile
(
init_path
):
open
(
init_path
,
"w"
)
.
close
()
# We just do this once per app
directory_created
[
app_label
]
=
True
with
open
(
writer
.
path
,
"w"
)
as
fh
:
fh
.
write
(
writer
.
as_string
())
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