Table of Contents

Class Constraint

Namespace
YndigoBlue.Velocity.Constraints
Assembly
YndigoBlue.Velocity.dll

Base class for all database constraints. Provides common constraint properties and comparison functionality.

public abstract class Constraint : IEquatable<Constraint>, IComparable<Constraint>
Inheritance
Constraint
Implements
Derived

Remarks

Constraints enforce data integrity rules at the database level. This abstract class defines the core properties shared by all constraint types: primary keys, foreign keys, unique constraints, check constraints, and default values.

Constructors

Constraint(string, string, string)

Initializes a new instance of the Constraint class.

Properties

ConstraintType

Gets the type of constraint (PrimaryKey, ForeignKey, Unique, Check, or Default).

Name

Gets or sets the name of the constraint.

SchemaName

Gets the name of the schema containing the table.

SchemaUpdate

Gets or sets whether this constraint is part of a schema update operation.

TableName

Gets the name of the table that owns this constraint.

Methods

CompareTo(Constraint)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Equals(Constraint)

Indicates whether the current object is equal to another object of the same type.

GetColumnsForComparison()

Gets columns for comparison in a name-neutral way. Override in subclasses that have columns.

IsEqual(Constraint)

Determines whether this constraint is equal to another constraint based on their properties.

ToString()

Returns a string that represents the current object.