PrimaryKeyConstraint does not support constraint name

Issue #266 resolved
Former user created an issue

Unlike ForeignKeyConstraint, which does support constraint name.

This should also applicable to all type of constraints.

Comments (6)

  1. Mike Bayer repo owner
    • marked as minor
    • changed milestone to 0.3.0
    • removed version

    the constructor supports a name field, it would just need to be added to ansisql.py visit_primary_key_constraint (and possibly reflection, for those db's that give a constraint name for pk):

    PrimaryKeyContraint('col1', 'col2', name='somename')
    

    feel free to submit a patch for this one.

  2. Former user Account Deleted

    Attached is the patch based on your suggestion.

    Unfortunately sqlite database does not support it, should sqlite.py be change to have it own visit_primary_key_constraint?

  3. Mike Bayer repo owner

    im not too concerned about sqlite at the moment since the "name" field of a primary key constraint sort of implies youre getting more specific about your schema in the first place...if you wanted to be database agnostic you'd probably leave the "name" off.

    patch applied in changeset:1826

  4. Log in to comment