diff --git a/django/core/management/commands/migrate.py b/django/core/management/commands/migrate.py index 622627142f..03e2a37ab1 100644 --- a/django/core/management/commands/migrate.py +++ b/django/core/management/commands/migrate.py @@ -46,6 +46,8 @@ class Command(BaseCommand): '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.') def handle(self, *args, **options): diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 86cd53ac1b..4db73e4244 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -753,6 +753,14 @@ option does not, however, check for matching database schema beyond matching table names and so is only safe to use if you are confident that your existing schema matches what is recorded in your initial migration. +.. django-admin-option:: --run-syncdb + +.. versionadded:: 1.9 + +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` diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index 85420bc941..5c0e3b613c 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -1215,9 +1215,12 @@ removed in Django 1.9 (please see the :ref:`deprecation timeline * Support for ``allow_syncdb`` on database routers is removed. -* The legacy method of syncing apps without migrations is removed, - and migrations are compulsory for all apps. This includes automatic - loading of ``initial_data`` fixtures and support for initial SQL data. +* Automatic syncing of apps without migrations is removed. Migrations are + compulsory for all apps unless you pass the :djadminopt:`--run-syncdb` + option to ``migrate``. + +* Support for automatic loading of ``initial_data`` fixtures and initial SQL + data is removed. * All models need to be defined inside an installed application or declare an explicit :attr:`~django.db.models.Options.app_label`. Furthermore, it isn't