1. Michael Bayer
  2. alembic
  3. Issues


Issue #101 resolved

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

Konsta 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. Michael Bayer repo owner

    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