Alembic: Support Comments on Table / Columns

Created on 17 Mar 2017  路  18Comments  路  Source: sqlalchemy/alembic

Migrated issue, originally created by Brice Maron (@emerzh)

Hi,
it seems that sqlalchemy supports comments on objects
(https://bitbucket.org/zzzeek/sqlalchemy/issues/1546/feature-request-commenting-db-objects)
which is awesome!

it could be really cool if it can be integrated to alembic as well

autogenerate - rendering feature

Most helpful comment

Mike Waites has proposed a fix for this issue in the master branch:

Implemented support for Table and Column Comments https://gerrit.sqlalchemy.org/932

All 18 comments

Michael Bayer (@zzzeek) wrote:

yeap....well that's SQLA 1.2 for a few months from now, should be an easy add to alembic...

Brice Maron (@emerzh) wrote:

Hi,
know that SQLA 1.2 is release and becoming more stable (with the dot release) is there something new on this front ?

Thanks for your work :)

Michael Bayer (@zzzeek) wrote:

this impacts autogenerate, as far as rendering "comment" in Table/ Column objects. from there, there is the possiblity of allowing alterations of comments. but we should start w/ the autogenerate part because that is more obvious and simple.

Sebastian Wehrmann (@sweh) wrote:

Any news on this one? Do u need help with the implementation?

Mike Waites (@mikeywaites) wrote:

Hi @sweh

I picked this up yesterday and have started working on it. I think i'm pretty much done however, Mike's away until Wednesday next week and there's a few things I need to run past him regarding my fix. I'll make sure I keep you posted

Sebastian Wehrmann (@sweh) wrote:

Hi Mike,

any chance you can pass me a diff or link to the branch with your fix?

Thanks in advance,
Sebastian

Michael Bayer (@zzzeek) wrote:

@sweh the work Mike was doing can be seen at https://github.com/mikeywaites/alembic/pull/1

Sebastian Wehrmann (@sweh) wrote:

Hi Michael,

thanks for the pointer to the github repository. I tried Mikes work and it works quite well so far, except for autogenerating the proper alter_column statements when adding comments to an existing table. Is this going to be implemented with this ticket?

Michael Bayer (@zzzeek) wrote:

that's probably part of the plan, yes, as part of the compare_column routine

Mike Waites (@mikeywaites) wrote:

Hi @sweh

Firstly apologies for taking so long on getting anywhere with this. I moved house across country right as i started working on this and it's taken me a while to get back into the swing of things. I just wanted to give you an update on where i'm at and let you know i've not stopped.

I took a slight detour to get some things set up to make it easier for myself and others to work with the various backends alembic/sqlalchemy projects support. Having done that I'll be spending some time to integrate my progress so far into the workflow @zzzeek uses so that we're all singing the same song.

I am pretty close to getting this finished I think so if you'd be happy to help test that would be a great help.

Changes by Michael Bayer (@zzzeek):

  • added labels: op directives

Changes by Michael Bayer (@zzzeek):

  • set milestone to "tier 1"

Changes by Michael Bayer (@zzzeek):

  • removed labels: op directives
  • added labels: autogenerate - rendering

I need this feature very much, hope to publish soon, thx.

@targetliu the review is ongoing at https://gerrit.sqlalchemy.org/#/c/sqlalchemy/alembic/+/932/. what you can do to help is try out this patch (see "download" dropdown in upper right) and see what works and what doesn't. Then you can leave comments on the gerrit or even if you wanted to push fixes to this review I can give you access to do that. it takes a village !

@TargetLiu @sweh

I'm really keen to get this wrapped up this week. I've been dragging this along for an age now. Could really appreciate some help testing if you have some time.

@TargetLiu @sweh

Scrap that. I've missed a pretty big chunk of the autogenerate flow so i'll work on that today. The famous "works in unit tests" problem :)

Apologies for this taking so long, Now i'm starting to get my head around the code base the next tickets will hopefully come faster.

Mike Waites has proposed a fix for this issue in the master branch:

Implemented support for Table and Column Comments https://gerrit.sqlalchemy.org/932

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sqlalchemy-bot picture sqlalchemy-bot  路  9Comments

WilliamMayor picture WilliamMayor  路  3Comments

zmwangx picture zmwangx  路  7Comments

abetkin picture abetkin  路  6Comments

MartinThoma picture MartinThoma  路  4Comments