Skip to content

Add if_exists for dropping postgres constraints #1650

@agriffin-grow

Description

@agriffin-grow

Describe the use case

In #1520, I added support for if_exists/if_not_exists on table commands. Previously it existed on only index commands.

This is a companion issue to support DROP CONSTRAINT IF EXISTS

Databases / Backends / Drivers targeted

Postgresql

Example Use

op.drop_constraint('foobar', 'table1', if_exists=True)

should produce

ALTER TABLE table1 DROP CONSTRAINT IF EXISTS foobar

Additional context
I'll be submitting a PR for this in a short while

Metadata

Metadata

Assignees

No one assigned

    Labels

    op directivesuse casenot quite a feature and not quite a bug, something we just didn't think of

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions