sqlalchemy.sql_schema.PrimaryKeyConstraint

Here are the examples of the python api sqlalchemy.sql_schema.PrimaryKeyConstraint taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

Example 1

Project: alembic Source File: batch.py
Function: add_constraint
    def add_constraint(self, const):
        if not const.name:
            raise ValueError("Constraint must have a name")
        if isinstance(const, sql_schema.PrimaryKeyConstraint):
            if self.table.primary_key in self.unnamed_constraints:
                self.unnamed_constraints.remove(self.table.primary_key)

        self.named_constraints[const.name] = const