Opened 4 years ago

Closed 2 years ago

#18672 closed New feature (fixed)

Model hooks for custom sql on syncdb and flush

Reported by: niwi Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords:
Cc: niwi@… Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no


In the thread of the group "django-developers" has spoken and has proposed a much more powerful alternative to the tickets they asked to make comments to the tables and fields. (#18468 and #13867)!topic/django-developers/KhsGj1b6rnU

Also, fix the ticket #16550 because it provides a unified way to insert custom sql in the process of syncdb.

Current work:

Change History (4)

comment:1 Changed 4 years ago by niwi

  • Cc niwi@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 4 years ago by lrekucki

  • Needs documentation set
  • Needs tests set
  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 3 years ago by akaariai

  • Triage Stage changed from Design decision needed to Accepted

I do think having a better way to install custom SQL is needed. For example if you need some views for your database the current ways of running the SQL is really lacking.

However the right solution is likely to wait for schema migrations, they could offer a much better solution than what hooks can offer. I am marking this as accepted in the meaning that a better way for installing custom SQL is needed. If the model hooks are the right way needs still more discussion.

comment:4 Changed 2 years ago by aaugustin

  • Resolution set to fixed
  • Status changed from new to closed

The new migrations framework provides a good way to do this, with its RunSQL operation.

Note: See TracTickets for help on using tickets.
Back to Top