Fixed #25144 -- Allowed migrate to create tables for apps without migrations.

This commit is contained in:
Tim Graham 2015-08-31 10:33:52 -04:00
parent cf29b6b561
commit 721d8e50ac
3 changed files with 16 additions and 3 deletions

View File

@ -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):

View File

@ -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`

View File

@ -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