[Dbix-class] DBIC/SQL::Translator is not preserving Postgres sequence names when deploying

Robert Rothenberg robrwo at gmail.com
Thu Feb 16 19:08:54 GMT 2012


I've run into a strange issue.

We have a Postgres database where the sequences used for primary keys are
explicitly named, e.g. "user_sequence" instead of the implicit names, such
as "user_id_seq".

We've created our DBIx::Result classes (via Catalyst's myapp_create script)
from that database.  The sequence names are in the classes, e.g.

__PACKAGE__->add_columns(
  "id",
  {
    data_type         => "integer",
    is_auto_increment => 1,
    is_nullable       => 0,
    sequence          => "user_sequence",
  },
  ...
);

But when we deploy a new database from those classes, the sequences aren't
named, which actually causes problems with some SQL scripts that directly
refer to those sequences.

Is there some way to get the deployment to name sequences? Or is this a bug
in the deployment?

Regards,
Rob



More information about the DBIx-Class mailing list