#24481: Allow use of sql* commands even on apps with migrations -------------------------------------+------------------------------------- Reporter: pakal | Owner: nobody Type: Bug | Status: new Component: Core (Management | Version: 1.7 commands) | Severity: Normal | Resolution: Keywords: migrate migrations | Triage Stage: sqlall | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by pakal): Do you mean "sqlmigrate" would output, in sequence, all "alter tables" commands to recreate the final DBs ? I've had a look at django\core\management\sql.py, a function check_for_migrations() is called to abort when some models use migrations, but other than that, nothing seems to prevent generation from sql for migration-enabled models. There is even, farther, code which looks explicitely dedicated to migration handling ("for model in router.get_migratable_models(app_config, connection.alias, include_auto_created=True)"). From what I understand, these sql* commands browse '''current''' model objects, and convert them to sql statements, so I guess they shouldn't care about whether these python classes have some "history" behind them. Or am I misunderstanding how all that works ? -- Ticket URL: <https://code.djangoproject.com/ticket/24481#comment:2> 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/063.383d3b6d6507dc05f922e1ab3d0c3be4%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.