class Marten::DB::Management::Constraint::Unique
- Marten::DB::Management::Constraint::Unique
- Reference
- Object
Overview
Represents a unique constraint used when creating or altering tables.
Included Modules
Defined in:
marten/db/management/constraint/unique.crConstructors
-
.from(unique_constraint : DB::Constraint::Unique) : Unique
Returns a management unique constraint from a unique constraint definition.
- .new(name : String | Symbol, column_names : Array(String | Symbol))
Instance Method Summary
-
#==(other : self)
Returns true if the other unique constraint corresponds to the same unique constraint configuration.
-
#clone
Returns a copy of the unique constraint.
-
#column_names : Array(String)
Returns the column names that are part of the unique constraint.
-
#name : String
Returns the unique constraint name.
-
#serialize_args : String
Returns a serialized version of the unique constraint arguments to be used when generating migrations.
Instance methods inherited from module Marten::DB::CanFormatStringsOrSymbols
format_string_or_symbol(value : String)
format_string_or_symbol
Constructor Detail
Returns a management unique constraint from a unique constraint definition.
Instance Method Detail
Returns true if the other unique constraint corresponds to the same unique constraint configuration.
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.