class

Marten::DB::Management::Constraint::Unique

Inherits Marten::DB::CanFormatStringsOrSymbols / Reference / Object

Represents a unique constraint used when creating or altering tables.

Constructors

from(unique_constraint : DB::Constraint::Unique) : Unique

Returns a management unique constraint from a unique constraint definition.

Source
new(name : String | Symbol, column_names : Array(String | Symbol))
Source

Instance methods

==(other : self)

Returns true if the other unique constraint corresponds to the same unique constraint configuration.

Source
clone

Returns a copy of the unique constraint.

Source
column_names

Returns the column names that are part of the unique constraint.

Source
name

Returns the unique constraint name.

Source
serialize_args

Returns a serialized version of the unique constraint arguments to be used when generating migrations.

The returned string will be used in the context of add_unique_constraint / unique_constraint statements in generated migrations.

Source