Hi Philip, On 12/04/2014 02:28 PM, Philip Haynes wrote: > Hi, > I have tracked back through the messages in this group and examined the > documentation for version 1.7 of Django and I have a question. > > The 1.7 documentation > (https://docs.djangoproject.com/en/1.7/howto/initial-data/) > describes the "Providing initial SQL data" functionality as deprecated. Is > that referring to using this hook for any SQL processing or just for the > loading of initial data? From the phrasing in the documentation it is not > clear to me if the entire hook for loading SQL code after the CREATE TABLE > statement is deprecated or whether it is just deprecated for initial data. > The deprecation comment refers to using Migrations to achieve the purpose, > I can do that, its just a bit more inconvenient than loading my sql > directly. > > FWIW, my goal is to insert triggers into a few places in the database. I > would prefer triggers because I have non-Django processes that can interact > with the database and it is most robust for me to have the RDBMS itself > perform the work. > > Anybody have a definitive understanding of the deprecation of the hook for > loading app/<model_name>.sql ?
The entire mechanism is deprecated in favor of using a migration with a RunSQL operation. Already in 1.7, for any app using migrations, initial SQL files will be ignored. In a world in which database tables are constructed entirely via migrations (which is already the case for any app with migrations, and will be the case for all apps in Django 1.9), the initial-SQL feature just doesn't make sense: it duplicates the RunSQL operation, and it is unclear when in the chain of migrations it would be expected to run. Carl -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5480D885.8090908%40oddbird.net. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: OpenPGP digital signature