I found that this issue had been discussed in Ticket #58 of DataMapper, apparently way back in 2007, but I can't find how to do it in the latest version (dm-core-0.10.2). I want to define two composite indexes, each of which are partially based on a certain property. I was hoping I could do this...
class Stat
include DataMapper::Resource
property :id, Serial,
property :collected_on, Integer #yyyyMMddhhmm
property :measure, Integer
property :dimension_one, Integer
property :dimension_two, Integer
property :source_id, Integer
index [:collected_on, :dimension_one, :dimension_two]
index [:source_id, :collected_on]
end
What is the correct way to do it?