#29026: Make makemigrations scriptable / script-friendly -------------------------------------+------------------------------------- Reporter: Chris Jerdonek | Owner: nobody Type: | Status: new Cleanup/optimization | Component: Migrations | Version: master Severity: Normal | Resolution: Keywords: | Triage Stage: makemigrations,scripting,stderr,stdout| Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by astandley): The current makemigrations command would seem to allow for everything you have asked. {{{ >> python -m manage makemigrations Migrations for 'newspaper': newspaper\migrations\0001_initial.py - Create model People >> python -m manage makemigrations Migrations for 'newspaper': newspaper\migrations\0001_initial.py - Create model People }}} Addressing each point: Output written to stdout rather than stderr. You can redirect stdout to stderr for the execution of the command if you want the output in stderr. (Using sys in python, or pipes for a shell script) A structured / programmatic way to figure out what files it has created. Run a regex on the output of the migration command. Example pattern: {{{r'Migrations for '(?P<app_name>[^']*)':\n (?P<migration_file>[^\n]*)'}}} Is there a reason this would not meet your needs? -- Ticket URL: <https://code.djangoproject.com/ticket/29026#comment:1> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.cc7841be03105725c4ec8a5234627a34%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.