2013-06-08 01:47:17 +08:00
|
|
|
import warnings
|
2009-12-22 23:18:51 +08:00
|
|
|
from optparse import make_option
|
2013-06-08 01:47:17 +08:00
|
|
|
from django.db import DEFAULT_DB_ALIAS
|
2012-06-06 19:53:12 +08:00
|
|
|
from django.core.management import call_command
|
2007-08-16 22:34:01 +08:00
|
|
|
from django.core.management.base import NoArgsCommand
|
2007-08-16 14:06:55 +08:00
|
|
|
|
|
|
|
|
2007-08-16 22:34:01 +08:00
|
|
|
class Command(NoArgsCommand):
|
2007-09-10 05:57:59 +08:00
|
|
|
option_list = NoArgsCommand.option_list + (
|
|
|
|
make_option('--noinput', action='store_false', dest='interactive', default=True,
|
|
|
|
help='Tells Django to NOT prompt the user for input of any kind.'),
|
2012-06-05 22:46:15 +08:00
|
|
|
make_option('--no-initial-data', action='store_false', dest='load_initial_data', default=True,
|
|
|
|
help='Tells Django not to load any initial data after database synchronization.'),
|
2009-12-22 23:18:51 +08:00
|
|
|
make_option('--database', action='store', dest='database',
|
|
|
|
default=DEFAULT_DB_ALIAS, help='Nominates a database to synchronize. '
|
|
|
|
'Defaults to the "default" database.'),
|
2007-09-10 05:57:59 +08:00
|
|
|
)
|
2013-06-08 01:47:17 +08:00
|
|
|
help = "Deprecated - use 'migrate' instead."
|
2007-08-16 14:06:55 +08:00
|
|
|
|
2007-08-16 22:34:01 +08:00
|
|
|
def handle_noargs(self, **options):
|
2013-06-08 01:47:17 +08:00
|
|
|
warnings.warn("The syncdb command will be removed in Django 1.9", PendingDeprecationWarning)
|
|
|
|
call_command("migrate", **options)
|