diff --git a/south/management/commands/schemamigration.py b/south/management/commands/schemamigration.py
|
a
|
b
|
class Command(DataCommand): |
| 39 | 39 | help='Attempt to automatically detect differences from the last migration.'), |
| 40 | 40 | make_option('--empty', action='store_true', dest='empty', default=False, |
| 41 | 41 | help='Make a blank migration.'), |
| | 42 | make_option('--edit', action='store_true', dest='edit_migration', default=False, |
| | 43 | help='Edit the file after creating it.'), |
| 42 | 44 | ) |
| 43 | 45 | help = "Creates a new template schema migration for the given app" |
| 44 | 46 | usage_str = "Usage: ./manage.py schemamigration appname migrationname [--empty] [--initial] [--auto] [--add-model ModelName] [--add-field ModelName.field_name] [--stdout]" |
| 45 | 47 | |
| 46 | | def handle(self, app=None, name="", added_model_list=None, added_field_list=None, freeze_list=None, initial=False, auto=False, stdout=False, added_index_list=None, verbosity=1, empty=False, **options): |
| | 48 | def handle(self, app=None, name="", added_model_list=None, added_field_list=None, freeze_list=None, initial=False, auto=False, stdout=False, added_index_list=None, verbosity=1, empty=False, edit_migration=False, **options): |
| 47 | 49 | |
| 48 | 50 | # Any supposed lists that are None become empty lists |
| 49 | 51 | added_model_list = added_model_list or [] |
| … |
… |
class Command(DataCommand): |
| 170 | 172 | print >>sys.stderr, "Created %s. You must now edit this migration and add the code for each direction." % new_filename |
| 171 | 173 | else: |
| 172 | 174 | print >>sys.stderr, "Created %s. You can now apply this migration with: ./manage.py migrate %s" % (new_filename, app) |
| | 175 | if edit_migration: |
| | 176 | os.system('%s %s' % (os.environ['EDITOR'], os.path.join(migrations.migrations_dir(), new_filename))) |
| 173 | 177 | |
| 174 | 178 | |
| 175 | 179 | MIGRATION_TEMPLATE = """# encoding: utf-8 |