#253 ✓resolved
David

DataMapper.repository.auto_migrate! fails

Reported by David | May 6th, 2008 @ 01:24 PM

I'm running edge Merb and edge DM.

merb-gen app zoo
merb-gen model lion name:string content:text created_at:date_time
class Lion
  include DataMapper::Resource

  property :name, String
  property :content, Text
  property :created_at, DateTime

end
merb -i
pp DataMapper.repository
#<DataMapper::Repository:0x189325c
 @adapter=
  #<DataMapper::Adapters::MysqlAdapter:0x138fbc0
   @field_naming_convention=DataMapper::NamingConventions::Underscored,
   @name=:default,
   @resource_naming_convention=
    DataMapper::NamingConventions::UnderscoredAndPluralized,
   @transactions={},
   @uri=
    #<Addressable::URI:0x9c6102 URI:mysql://david@localhost/zoo_development?socket=/tmp/mysql.sock>>,
 @identity_maps={},
 @name=:default>
=> nil
>> DataMapper.repository.auto_migrate!
ArgumentError: +name+ should be a Symbol, but was DataMapper::Repository
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper.rb:157:in `new'
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper.rb:157:in `repository'
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper/resource.rb:303:in `repository'
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper/auto_migrations.rb:14:in `auto_migrate!'
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper/auto_migrations.rb:35:in `auto_migrate'
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper/auto_migrations.rb:34:in `each'
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper/auto_migrations.rb:34:in `auto_migrate'
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper/repository.rb:109:in `auto_migrate!'
	from (irb):2
	from :0

Comments and changes to this ticket

  • David

    David May 6th, 2008 @ 01:40 PM

    This works:

    DataMapper::AutoMigrator.auto_migrate(:default)

  • David

    David May 6th, 2008 @ 01:42 PM

    DataMapper.auto_migrate! fails in the same way:

    ArgumentError: +name+ should be a Symbol, but was DataMapper::Repository
    	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper.rb:157:in `new'
    	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper.rb:157:in `repository'
    	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper/resource.rb:303:in `repository'
    	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper/auto_migrations.rb:14:in `auto_migrate!'
    	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper/auto_migrations.rb:35:in `auto_migrate'
    	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper/auto_migrations.rb:34:in `each'
    	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper/auto_migrations.rb:34:in `auto_migrate'
    	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper/repository.rb:109:in `auto_migrate!'
    	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.0/lib/data_mapper.rb:181:in `auto_migrate!'
    	from (irb):12
    
  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) May 6th, 2008 @ 06:25 PM

    • Milestone cleared.
    • State changed from “new” to “resolved”
    • Assigned user set to “Dan Kubb (dkubb)”

    This ticket was resolved by the following commits:

    http://github.com/sam/dm-core/co...

    http://github.com/sam/dm-more/co...

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Tags

Pages