Comments (6)
Inside the extract_function(), it gets called here.
Please add an option to turn function renaming on/off. In case someone wants to opt out.
Lastly. Please add tests. I can't stress this last one enough.
from django-squash.
That makes sense, PRs are welcome :D
from django-squash.
@kingbuzzman Since you know the codebase, can you please point me to the relevant parts of the source code that I should study in order to change and implement the proposed feature? This will probably save me some debug time....
from django-squash.
@luzfcb I really want to close this issue, but didnt want to leave you hanging either.
I started https://github.com/kingbuzzman/django-squash/pull/42/files to address this, im not sold on the name DJANGO_SQUASH_CUSTOM_RENAME_FUNCTION
-- but its a working draft.
The idea is that you define a function somewhere in your code, and add DJANGO_SQUASH_CUSTOM_RENAME_FUNCTION='dot.path.location.where.is.the.function'
in your settings.py
and implement it obviously.. then this function would be called every time the squash finds an non-elidable operation and you can there dictate the name of the function. Still need to write an integration test for it.
But, does this work? is this what you had in mind? So far here are the variables you would have available migration
(where the function is), name
(name of function), app
(name of the app), operation
(operation object). From there you can name the functinon as you see fit.
Please let me know what you think. Thanks
from django-squash.
Related Issues (10)
- Touches migrations inside site-packages HOT 4
- `rename_migrations` can fail if migration name does not start with 4 ints HOT 6
- Import issues
- Issue with RunPython functions being part of the class
- 6/site-packages/django_squash/apps.py", line 2, in <module> from django.db.migrations.serializer import Serializer HOT 2
- IndexError: list index out of range HOT 4
- Hello again, sorry I missed your answer. So I plan to reopen issue, cause I tried to squash my migrations again :) HOT 4
- Installed database extensions are not kept in the squashed migrations HOT 6
- NameError: name 'RunPython' is not defined HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-squash.