lib/rom/sql/migration/inline_runner.rb in rom-sql-2.0.0.beta1 vs lib/rom/sql/migration/inline_runner.rb in rom-sql-2.0.0.beta2
- old
+ new
@@ -35,12 +35,16 @@
else
column attribute.name, attribute.type, null: attribute.null?
end
end
- diff.indexes.each do |idx|
- index idx.attribute
+ diff.indexes.each do |index|
+ index index.attributes,
+ name: index.name,
+ unique: index.unique?,
+ type: index.type,
+ where: index.predicate
end
end
end
def alter_table(diff)
@@ -70,12 +74,16 @@
end
diff.index_changes.each do |index|
case index
when SchemaDiff::IndexAdded
- add_index index.attribute
+ add_index index.attributes,
+ name: index.name,
+ unique: index.unique?,
+ type: index.type,
+ where: index.predicate
when SchemaDiff::IndexRemoved
- drop_index index.attribute
+ drop_index index.attributes, name: index.name
end
end
end
end
end