Class: ActiveGraph::Schema::UniqueConstraintOperation
- Inherits:
-
Operation
- Object
- Operation
- ActiveGraph::Schema::UniqueConstraintOperation
show all
- Defined in:
- lib/active_graph/schema/operation.rb
Instance Attribute Summary
Attributes inherited from Operation
#label, #options, #property
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Operation
#drop!, #drop_incompatible!, #incompatible_operation_classes, #initialize, #label_object
Class Method Details
.incompatible_operation_classes ⇒ Object
80
81
82
|
# File 'lib/active_graph/schema/operation.rb', line 80
def self.incompatible_operation_classes
[ExactIndexOperation]
end
|
Instance Method Details
#create! ⇒ Object
88
89
90
91
|
# File 'lib/active_graph/schema/operation.rb', line 88
def create!
return if exist?
super
end
|
#default_options ⇒ Object
97
98
99
|
# File 'lib/active_graph/schema/operation.rb', line 97
def default_options
{type: :unique}
end
|
#exist? ⇒ Boolean
93
94
95
|
# File 'lib/active_graph/schema/operation.rb', line 93
def exist?
label.uniqueness_constraint?(property)
end
|
#type ⇒ Object
84
85
86
|
# File 'lib/active_graph/schema/operation.rb', line 84
def type
'uniqueness_constraint'
end
|