how do I migrate Datamapper on appengine

Posted by Roy on Stack Overflow See other posts from Stack Overflow or by Roy
Published on 2010-05-14T22:29:08Z Indexed on 2010/05/14 22:34 UTC
Read the original article Hit count: 291

I've changed my model from

class Place
  include DataMapper::Resource
  has n, :trails

  property :id,           Serial
  property :name,         String,         :length => 140
  property :tag,          String,         :required => true
  timestamps :at 
end

to

class Place
  include DataMapper::Resource
  has n, :trails

  property :id,           Serial
  property :name,         String,         :length => 140
  property :tag,          String,         :required => true
  property :trail_count,  Integer,        :default => 0
  timestamps :at 
end

I just added "property :trail_count, Integer, :default => 0"

and i want to migrate the existing appengine table to have the extra field "trail_count" i've read that DataMapper.auto_upgrade! should do it.

but i get an error "undefined method `auto_upgrade!' for DataMapper:Module"

can you please help How do i migrate the DM models?

© Stack Overflow or respective owner

Related posts about migrate

Related posts about datamapper