jjn1056 / DBIx-Class-Migration

Use DBIC::DeploymentHandler and DBIC::Fixtures together for a sane database versioning workflow
33 stars 41 forks source link

Comments are not copied from Result class to database #143

Open willsheppard opened 3 years ago

willsheppard commented 3 years ago

During the prepare step, Postgres table and row comments are copied from the database into appropriate places in the Result classes - that's an excellent feature and it works correctly.

But at the install step, the same comments are NOT copied from the Result classes into the Postgres database.

I have not checked MySQL.

rabbiveesh commented 3 years ago

is it possible for you to prepare a minimal repro of this issue? I'm not really understanding what you mean by database comments.

AFAIK, the prepare step generates DDL from classes, not classes from DDL, so I don't really understand the problem you're describing at all.

On Wed, Aug 11, 2021 at 12:50 AM Will Sheppard @.***> wrote:

During the prepare step, Postgres table and row comments are copied from the database into appropriate places in the Result classes - that's an excellent feature and it works correctly.

But at the install step, the same comments are NOT copied from the Result classes into the Postgres database.

I have not checked MySQL.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jjn1056/DBIx-Class-Migration/issues/143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFURPKUG6H6RHWRMEQ6AV5TT4GNLRANCNFSM5B44MPXQ .

willsheppard commented 3 years ago

The database comments I'm referring to are Postgres comments:

comment on column session_log.userid is 'The user ID';

If I generate a set of migration files from an existing Postgres database (once, to import a legacy database into DBIx::Class::Migration), then those Postgres comments do get copied into POD within a DBIx::Class ResultSet file, which is good.

But the comments don't survive a round-trip: When I run the install action, I don't end up with Postgres comments on tables and columns in my Postgres database.

I can make a minimal example if needed.

rabbiveesh commented 3 years ago

At the very least, I'd like to see the generated class with the comments. Depending on what that looks like, it may not be technically feasible to copy them into the DB.

On Sun, Aug 22, 2021, 11:31 Will Sheppard @.***> wrote:

The database comments I'm referring to are Postgres comments:

comment on column session_log.userid is 'The user ID';

If I generate a set of migration files from an existing Postgres database, then those Postgres comments get copied into a DBIx::Class ResultSet, which is good.

But the comments don't survive a round-trip: When I run the install action, I don't end up with Postgres comments on tables and columns in my Postgres database.

I can make a minimal example if needed.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jjn1056/DBIx-Class-Migration/issues/143#issuecomment-903233402, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFURPKX23KRIEYALOYU4VVTT6CYVFANCNFSM5B44MPXQ .