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
b6e6fcf3
Kaydet (Commit)
b6e6fcf3
authored
Eyl 01, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #23359 -- Removed the migrate --list option per deprecation timeline.
üst
e5c12f67
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
61 deletions
+1
-61
migrate.py
django/core/management/commands/migrate.py
+0
-23
django-admin.txt
docs/ref/django-admin.txt
+0
-5
test_commands.py
tests/migrations/test_commands.py
+1
-33
No files found.
django/core/management/commands/migrate.py
Dosyayı görüntüle @
b6e6fcf3
...
...
@@ -2,12 +2,10 @@
from
__future__
import
unicode_literals
import
time
import
warnings
from
collections
import
OrderedDict
from
importlib
import
import_module
from
django.apps
import
apps
from
django.core.management
import
call_command
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.core.management.sql
import
(
emit_post_migrate_signal
,
emit_pre_migrate_signal
,
...
...
@@ -17,7 +15,6 @@ from django.db.migrations.autodetector import MigrationAutodetector
from
django.db.migrations.executor
import
MigrationExecutor
from
django.db.migrations.loader
import
AmbiguityError
from
django.db.migrations.state
import
ProjectState
from
django.utils.deprecation
import
RemovedInDjango110Warning
from
django.utils.module_loading
import
module_has_submodule
...
...
@@ -45,8 +42,6 @@ class Command(BaseCommand):
help
=
'Detect if tables already exist and fake-apply initial migrations if so. Make sure '
'that the current database schema matches your initial migration before using this '
'flag. Django will only check for an existing table name.'
)
parser
.
add_argument
(
'--list'
,
'-l'
,
action
=
'store_true'
,
dest
=
'list'
,
default
=
False
,
help
=
'Show a list of all known migrations and which are applied.'
)
parser
.
add_argument
(
'--run-syncdb'
,
action
=
'store_true'
,
dest
=
'run_syncdb'
,
help
=
'Creates tables for apps without migrations.'
)
...
...
@@ -65,24 +60,6 @@ class Command(BaseCommand):
db
=
options
.
get
(
'database'
)
connection
=
connections
[
db
]
# If they asked for a migration listing, quit main execution flow and show it
if
options
.
get
(
"list"
,
False
):
warnings
.
warn
(
"The 'migrate --list' command is deprecated. Use 'showmigrations' instead."
,
RemovedInDjango110Warning
,
stacklevel
=
2
)
self
.
stdout
.
ending
=
None
# Remove when #21429 is fixed
return
call_command
(
'showmigrations'
,
'--list'
,
app_labels
=
[
options
[
'app_label'
]]
if
options
[
'app_label'
]
else
None
,
database
=
db
,
no_color
=
options
.
get
(
'no_color'
),
settings
=
options
.
get
(
'settings'
),
stdout
=
self
.
stdout
,
traceback
=
options
.
get
(
'traceback'
),
verbosity
=
self
.
verbosity
,
)
# Hook for backends needing any database preparation
connection
.
prepare_database
()
# Work out which apps have migrations and which do not
...
...
docs/ref/django-admin.txt
Dosyayı görüntüle @
b6e6fcf3
...
...
@@ -768,11 +768,6 @@ The ``--run-syncdb`` option allows creating tables for apps without migrations.
While this isn't recommended, the migrations framework is sometimes too slow
on large projects with hundreds of models.
.. deprecated:: 1.8
The ``--list`` option has been moved to the :djadmin:`showmigrations`
command.
runserver [port or address:port]
--------------------------------
...
...
tests/migrations/test_commands.py
Dosyayı görüntüle @
b6e6fcf3
...
...
@@ -9,9 +9,8 @@ from django.apps import apps
from
django.core.management
import
CommandError
,
call_command
from
django.db
import
DatabaseError
,
connection
,
models
from
django.db.migrations.recorder
import
MigrationRecorder
from
django.test
import
ignore_warnings
,
mock
,
override_settings
from
django.test
import
mock
,
override_settings
from
django.utils
import
six
from
django.utils.deprecation
import
RemovedInDjango110Warning
from
django.utils.encoding
import
force_text
from
.models
import
UnicodeModel
,
UnserializableModel
...
...
@@ -160,37 +159,6 @@ class MigrateTests(MigrationTestBase):
with
self
.
assertRaisesMessage
(
CommandError
,
"Conflicting migrations detected"
):
call_command
(
"migrate"
,
"migrations"
)
@ignore_warnings
(
category
=
RemovedInDjango110Warning
)
@override_settings
(
MIGRATION_MODULES
=
{
"migrations"
:
"migrations.test_migrations"
})
def
test_migrate_list
(
self
):
"""
Tests --list output of migrate command
"""
out
=
six
.
StringIO
()
with
mock
.
patch
(
'django.core.management.color.supports_color'
,
lambda
*
args
:
True
):
call_command
(
"migrate"
,
list
=
True
,
stdout
=
out
,
verbosity
=
0
,
no_color
=
False
)
self
.
assertEqual
(
'
\x1b
[1mmigrations
\n\x1b
[0m'
' [ ] 0001_initial
\n
'
' [ ] 0002_second
\n
'
,
out
.
getvalue
()
.
lower
()
)
call_command
(
"migrate"
,
"migrations"
,
"0001"
,
verbosity
=
0
)
out
=
six
.
StringIO
()
# Giving the explicit app_label tests for selective `show_migration_list` in the command
call_command
(
"migrate"
,
"migrations"
,
list
=
True
,
stdout
=
out
,
verbosity
=
0
,
no_color
=
True
)
self
.
assertEqual
(
'migrations
\n
'
' [x] 0001_initial
\n
'
' [ ] 0002_second
\n
'
,
out
.
getvalue
()
.
lower
()
)
# Cleanup by unmigrating everything
call_command
(
"migrate"
,
"migrations"
,
"zero"
,
verbosity
=
0
)
@override_settings
(
MIGRATION_MODULES
=
{
"migrations"
:
"migrations.test_migrations"
})
def
test_showmigrations_list
(
self
):
"""
...
...
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