#1297 ✓resolved
kgiszczak

dm-rails: dm:create/dm:drop tasks doesn't work with mysql adapter

Reported by kgiszczak | May 29th, 2010 @ 04:31 AM | in 1.0.0

I created fresh rails3 project, and changed only this files:

Gemfile:

 source 'http://rubygems.org'
 gem 'activesupport',        '~> 3.0.0.beta3', :require => 'active_support'
 gem 'actionpack',           '~> 3.0.0.beta3', :require => 'action_pack'
 gem 'railties',             '~> 3.0.0.beta3', :require => 'rails'
 gem 'actionmailer',         '~> 3.0.0.beta3', :require => 'action_mailer'
 gem 'dm-rails',             '~> 1.0.0.rc3',  :git => 'git://github.com/datamapper/dm-rails.git'
 gem 'dm-migrations',        '~> 1.0.0.rc3',  :git => 'git://github.com/datamapper/dm-migrations.git'
 gem 'dm-types',             '~> 1.0.0.rc3',  :git => 'git://github.com/datamapper/dm-types.git'
 gem 'dm-validations',       '~> 1.0.0.rc3',  :git => 'git://github.com/datamapper/dm-validations.git'
 gem 'dm-constraints',       '~> 1.0.0.rc3',  :git => 'git://github.com/datamapper/dm-constraints.git'
 gem 'dm-transactions',      '~> 1.0.0.rc3',  :git => 'git://github.com/datamapper/dm-transactions.git'
 gem 'dm-aggregates',        '~> 1.0.0.rc3',  :git => 'git://github.com/datamapper/dm-aggregates.git'
 gem 'dm-timestamps',        '~> 1.0.0.rc3',  :git => 'git://github.com/datamapper/dm-timestamps.git'
 gem 'dm-observer',          '~> 1.0.0.rc3',  :git => 'git://github.com/datamapper/dm-observer.git'
 gem 'dm-mysql-adapter',     '~> 1.0.0.rc3',  :git => 'git://github.com/datamapper/dm-mysql-adapter.git'
 gem 'dm-is-state_machine',  '~> 1.0.0.rc3',  :git => 'git://github.com/datamapper/dm-is-state_machine.git'
 gem 'dm-core',              '~> 1.0.0.rc3',  :git => 'git://github.com/datamapper/dm-core.git'
 gem 'dm-do-adapter',        '~> 1.0.0.rc3',  :git => 'git://github.com/datamapper/dm-do-adapter.git'

application.rb:
replaced require 'rails/all' with:

require 'dm-migrations'

require 'action_controller/railtie'
require 'action_mailer/railtie'
require 'dm-rails/railtie'

and database.yml:

development:
  adapter: mysql
  database: test
  username: root
  password:


test: adapter: mysql database: test username: root password:


production: adapter: mysql database: test username: root password:

When I do rake db:create I get this messages:

 Kamil-Giszczaks-MacBook-Pro-2:test_app beerkg$ rake db:create
 (in /Users/beerkg/beercorp/test_app)
 [datamapper] Setting up the "development" environment:
 [datamapper] Setting up :default repository: 'test' on mysql
 [datamapper] Created database 'test'
 [datamapper] Created database 'test'

But database 'test' isn't created.

When I do rake db:drop I get this message:

 Kamil-Giszczaks-MacBook-Pro-2:test_app beerkg$ rake db:drop
 (in /Users/beerkg/beercorp/test_app)
 [datamapper] Setting up the "development" environment:
 [datamapper] Setting up :default repository: 'test' on mysql
 [datamapper] Dropped database 'test'
 [datamapper] Dropped database 'test'

This tasks run without errors but database 'test' doesn't exists.

For postgres adapter everything works fine.

Comments and changes to this ticket

  • Martin Gamsjaeger (snusnu)

    Martin Gamsjaeger (snusnu) May 29th, 2010 @ 12:05 PM

    • Milestone set to 1.0.0
    • State changed from “new” to “resolved”
    • Assigned user set to “Martin Gamsjaeger (snusnu)”

    I can't reproduce that on 1.0.0.rc3. Marking this as resolved

  • kgiszczak

    kgiszczak May 30th, 2010 @ 04:16 AM

    I've done some research and found out why this tasks doesn't work for me.
    I don't have mysql command in my system path, and dm-rails imply that mysql(for mysql adapter) and
    createdb, dropdb(for postgres adapter) commands are in system path.

    Maybe there should be displayed some error message when this tasks fails.
    Now it's very confusing when messages displayed by this tasks indicate
    that every things is ok, but database isn't created.

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 »

Pages