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
6b3e17ba
Kaydet (Commit)
6b3e17ba
authored
Haz 25, 2018
tarafından
oliver
Kaydeden (comit)
Tim Graham
Haz 25, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #29518 -- Added validation for sqlmigrate's app_label argument.
üst
e7185a65
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
AUTHORS
AUTHORS
+1
-0
sqlmigrate.py
django/core/management/commands/sqlmigrate.py
+6
-0
test_commands.py
tests/migrations/test_commands.py
+8
-0
No files found.
AUTHORS
Dosyayı görüntüle @
6b3e17ba
...
...
@@ -739,6 +739,7 @@ answer newbie questions, and generally made Django that much better:
Sean Brant
Sebastian Hillig <sebastian.hillig@gmail.com>
Sebastian Spiegel <http://www.tivix.com/>
Segyo Myung <myungsekyo@gmail.com>
Selwin Ong <selwin@ui.co.id>
Sengtha Chay <sengtha@e-khmer.com>
Senko Rašić <senko.rasic@dobarkod.hr>
...
...
django/core/management/commands/sqlmigrate.py
Dosyayı görüntüle @
6b3e17ba
from
django.apps
import
apps
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.db
import
DEFAULT_DB_ALIAS
,
connections
from
django.db.migrations.executor
import
MigrationExecutor
...
...
@@ -37,6 +38,11 @@ class Command(BaseCommand):
# Resolve command-line arguments into a migration
app_label
,
migration_name
=
options
[
'app_label'
],
options
[
'migration_name'
]
# Validate app_label
try
:
apps
.
get_app_config
(
app_label
)
except
LookupError
as
err
:
raise
CommandError
(
str
(
err
))
if
app_label
not
in
executor
.
loader
.
migrated_apps
:
raise
CommandError
(
"App '
%
s' does not have migrations"
%
app_label
)
try
:
...
...
tests/migrations/test_commands.py
Dosyayı görüntüle @
6b3e17ba
...
...
@@ -1434,6 +1434,14 @@ class AppLabelErrorTests(TestCase):
with
self
.
assertRaisesMessage
(
CommandError
,
self
.
did_you_mean_auth_error
):
call_command
(
'migrate'
,
'django.contrib.auth'
)
def
test_sqlmigrate_nonexistent_app_label
(
self
):
with
self
.
assertRaisesMessage
(
CommandError
,
self
.
nonexistent_app_error
):
call_command
(
'sqlmigrate'
,
'nonexistent_app'
,
'0002'
)
def
test_sqlmigrate_app_name_specified_as_label
(
self
):
with
self
.
assertRaisesMessage
(
CommandError
,
self
.
did_you_mean_auth_error
):
call_command
(
'sqlmigrate'
,
'django.contrib.auth'
,
'0002'
)
def
test_squashmigrations_nonexistent_app_label
(
self
):
with
self
.
assertRaisesMessage
(
CommandError
,
self
.
nonexistent_app_error
):
call_command
(
'squashmigrations'
,
'nonexistent_app'
,
'0002'
)
...
...
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