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
7e941ba6
Kaydet (Commit)
7e941ba6
authored
Şub 12, 2014
tarafından
Andrew Godwin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Reverting unapplied migrations check away from being a system-level check.
This reverts commit
0ac13ecc
.
üst
dbe82e74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
32 deletions
+14
-32
__init__.py
django/core/checks/__init__.py
+0
-1
migrations.py
django/core/checks/migrations.py
+0
-31
runserver.py
django/core/management/commands/runserver.py
+14
-0
No files found.
django/core/checks/__init__.py
Dosyayı görüntüle @
7e941ba6
...
...
@@ -8,7 +8,6 @@ from .registry import register, run_checks, tag_exists
# Import these to force registration of checks
import
django.core.checks.compatibility.django_1_6_0
# NOQA
import
django.core.checks.migrations
# NOQA
import
django.core.checks.model_checks
# NOQA
__all__
=
[
...
...
django/core/checks/migrations.py
deleted
100644 → 0
Dosyayı görüntüle @
dbe82e74
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.conf
import
settings
from
.
import
Warning
,
register
@register
(
'migrations'
)
def
check_migrations
(
app_configs
=
None
,
**
kwargs
):
"""
Checks to see if the set of migrations on disk matches the
migrations in the database. Prints a warning if they don't match.
"""
from
django.db
import
connections
,
DEFAULT_DB_ALIAS
from
django.db.migrations.executor
import
MigrationExecutor
errors
=
[]
plan
=
None
if
settings
.
DATABASES
:
executor
=
MigrationExecutor
(
connections
[
DEFAULT_DB_ALIAS
])
plan
=
executor
.
migration_plan
(
executor
.
loader
.
graph
.
leaf_nodes
())
if
plan
:
errors
.
append
(
Warning
(
"You have unapplied migrations; "
"your app may not work properly until they are applied."
,
hint
=
"Run 'python manage.py migrate' to apply them."
,
)
)
return
errors
django/core/management/commands/runserver.py
Dosyayı görüntüle @
7e941ba6
...
...
@@ -10,6 +10,8 @@ import socket
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.core.servers.basehttp
import
run
,
get_internal_wsgi_application
from
django.db
import
connections
,
DEFAULT_DB_ALIAS
from
django.db.migrations.executor
import
MigrationExecutor
from
django.utils
import
autoreload
from
django.utils
import
six
...
...
@@ -99,6 +101,7 @@ class Command(BaseCommand):
self
.
stdout
.
write
(
"Performing system checks...
\n\n
"
)
self
.
validate
(
display_num_errors
=
True
)
self
.
check_migrations
()
now
=
datetime
.
now
()
.
strftime
(
'
%
B
%
d,
%
Y -
%
X'
)
if
six
.
PY2
:
now
=
now
.
decode
(
'utf-8'
)
...
...
@@ -143,5 +146,16 @@ class Command(BaseCommand):
self
.
stdout
.
write
(
shutdown_message
)
sys
.
exit
(
0
)
def
check_migrations
(
self
):
"""
Checks to see if the set of migrations on disk matches the
migrations in the database. Prints a warning if they don't match.
"""
executor
=
MigrationExecutor
(
connections
[
DEFAULT_DB_ALIAS
])
plan
=
executor
.
migration_plan
(
executor
.
loader
.
graph
.
leaf_nodes
())
if
plan
:
self
.
stdout
.
write
(
self
.
style
.
NOTICE
(
"
\n
You have unapplied migrations; your app may not work properly until they are applied."
))
self
.
stdout
.
write
(
self
.
style
.
NOTICE
(
"Run 'python manage.py migrate' to apply them.
\n
"
))
# Kept for backward compatibility
BaseRunserverCommand
=
Command
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