DataMapper.auto_upgrade! misses indexes

29 views
Skip to first unread message

Andrew Neil

unread,
Oct 4, 2009, 3:17:12 PM10/4/09
to datam...@googlegroups.com
I am trying to apply indexes to a few of my models. I've summarized
the relevant bits from my models in this pastie (and below):

http://pastie.org/641532

If I run `DataMapper.auto_migrate!` it creates the entire schema
including the indexes, so I think I've got the syntax right in my
models. However, if I run `DataMapper.auto_upgrade!` on my existing
database, the schema is not updated to include the indexes. I'm using
a sqlite3 database. Am I doing something wrong?

Thanks in advance.
Drew

=============================

The relevant bits of my models (see also http://pastie.org/641532):

class Status
include DataMapper::Resource

property :id, Serial
property :twitter_id, Integer, :index => true
property :text, String, :length => 0..255
property :created_at, DateTime, :index => true
...

end

class Noun
include DataMapper::Resource

property :id, Serial
property :plural, String, :length => 0..255, :index =>
true
...

end

class Collector
include DataMapper::Resource

property :id, Serial
property :name, String, :length => 0..255, :index
=> :collector
property :noun_id, Integer, :index
=> :collector
...

end

Andrew Neil

unread,
Oct 6, 2009, 2:05:27 PM10/6/09
to datam...@googlegroups.com
Looks like this is a bug, so I've filed a ticket for it:

http://datamapper.lighthouseapp.com/projects/20609-datamapper/tickets/1079-auto_upgrade-doesnt-apply-indexes

Cheers,
Drew
Reply all
Reply to author
Forward
0 new messages