#22271: Providing initial SQL data -------------------------------------+------------------------------------- Reporter: yejia2000@… | Owner: nobody Type: New feature | Status: closed Component: Database layer | Version: 1.6 (models, ORM) | Resolution: wontfix Severity: Normal | Triage Stage: Keywords: intial sql data, | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by russellm):
* status: new => closed * needs_better_patch: => 0 * resolution: => wontfix * needs_tests: => 0 * needs_docs: => 0 Comment: Well, strictly, I don't think there's anything that would stop you from putting all your initial SQL for an app into the file for a single model. The contents of initial SQL files aren't validated to make sure that they only apply to a single model, so the code will "just run". The only difference would be *when* the code is run; the model file you choose to put the initial SQL in will determine the order in which it is executed. During initial development, the initial SQL file for a particular model won't be run unless that the table for that model has been created. On top of all that, initial SQL is a pattern that is an "emergency escape hatch" - it's a way to handle the last 2% of use cases you can't hit with Django itself. I'm not sure it's worth spending a whole lot of time revamping initial SQL handling to support a slightly different organisation of initial SQL content. If you've got a particularly compelling use case that I've missed, please start a discussion on django-developers. -- Ticket URL: <https://code.djangoproject.com/ticket/22271#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/077.ed66c33ec86094897e8dbb64af2b1a64%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.