root / env / lib / python2.7 / site-packages / south / management / commands / startmigration.py @ d1a4905f
History | View | Annotate | Download (2.02 KB)
1 |
"""
|
---|---|
2 |
Now-obsolete startmigration command.
|
3 |
"""
|
4 |
|
5 |
from optparse import make_option |
6 |
|
7 |
from django.core.management.base import BaseCommand |
8 |
from django.core.management.color import no_style |
9 |
|
10 |
class Command(BaseCommand): |
11 |
option_list = BaseCommand.option_list + ( |
12 |
make_option('--model', action='append', dest='added_model_list', type='string', |
13 |
help='Generate a Create Table migration for the specified model. Add multiple models to this migration with subsequent --model parameters.'),
|
14 |
make_option('--add-field', action='append', dest='added_field_list', type='string', |
15 |
help='Generate an Add Column migration for the specified modelname.fieldname - you can use this multiple times to add more than one column.'),
|
16 |
make_option('--add-index', action='append', dest='added_index_list', type='string', |
17 |
help='Generate an Add Index migration for the specified modelname.fieldname - you can use this multiple times to add more than one column.'),
|
18 |
make_option('--initial', action='store_true', dest='initial', default=False, |
19 |
help='Generate the initial schema for the app.'),
|
20 |
make_option('--auto', action='store_true', dest='auto', default=False, |
21 |
help='Attempt to automatically detect differences from the last migration.'),
|
22 |
make_option('--freeze', action='append', dest='freeze_list', type='string', |
23 |
help='Freeze the specified model(s). Pass in either an app name (to freeze the whole app) or a single model, as appname.modelname.'),
|
24 |
make_option('--stdout', action='store_true', dest='stdout', default=False, |
25 |
help='Print the migration to stdout instead of writing it to a file.'),
|
26 |
) |
27 |
help = "Deprecated command"
|
28 |
|
29 |
def handle(self, app=None, name="", added_model_list=None, added_field_list=None, initial=False, freeze_list=None, auto=False, stdout=False, added_index_list=None, **options): |
30 |
|
31 |
print "The 'startmigration' command is now deprecated; please use the new 'schemamigration' and 'datamigration' commands." |