Issue #101 resolved

EnvironmentContext.configure(), new keyword argument callable: include_column

Konsta Vesterinen avatarKonsta Vesterinen created an issue

Similar to EnvironmentContext.configure() keyword argument 'include_symbol' I would like to be able to define callable called 'include_column' which would indicate whether or not given column should be included in the autogenerate process.

Real-life example: I have situations where the tables of my models have search_vector columns that are not defined within the model. This leads to situation where everytime I autogenerate migrations the search_vector columns are being added to the new migration file.

Comments (4)

  1. Mike Bayer

    looking at "include_symbol", the name and signature here is horrifying to me, how wrong I did this. because I definitely don't want an explosion of "include_XYZ" functions here, include_constraint, include_index, no way.

    So we have to deprecate include_symbol, which is a great name but unfortunately I've ruined it, and go with the approach used by sphinx, and I guess we can name it include_object, and it will be like this:

    def include_object(name, what, **kw):

    where "name" is the name of the object, "what" is the type: for starters, "schema", "table", "column", **kw is for modifiers, like if you get "table" for "what" there also would be a "schema" kw argument.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.