Re: Makemigrations hooks for third-party apps?

2021-12-17 Thread Javier Buzzi
A bit late, unrelated: what is the reason behind not having django just add the extension `HStoreExtension` when it detects `hstorefield`? From what i can see, there there is a `create .. if not exists` on the sql command, and seems like a no brainer. Thanks On Wednesday, June 7, 2017 at 2:42:

Re: Makemigrations hooks for third-party apps?

2017-06-13 Thread Josh Smeaton
Can you provide the operations that users can then import into their migrations, similarly to how contrib.postgres provides the HStoreExtension operation [0]? The import could even be a function taking the extended model that returns the appropriate operation. This might be a bit more lo-fi tha

Re: Makemigrations hooks for third-party apps?

2017-06-06 Thread charettes
Hello Craig, There's unfortunately no way to hook into the migration auto-detector to specify additional operations to be added. What I suggest you do instead is dynamically inject operations in the plan that is about to be run by connecting a pre_migrate signal. When you detect CreateModel ope

Makemigrations hooks for third-party apps?

2017-06-06 Thread Craig de Stigter
Hi there I'm in the early stages of developing a third party app which makes heavy use of postgres extensions. The app provides an abstract model, so I won't have direct control of user's models or migrations. I'm having trouble getting it to generate sensible migrations for users. At present the