Commit 721d8e50 authored by Tim Graham's avatar Tim Graham
Browse files

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

parent cf29b6b5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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):

+8 −0
Original line number Diff line number Diff line
@@ -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`
+6 −3
Original line number Diff line number Diff line
@@ -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