This repository was archived by the owner on Apr 17, 2018. It is now read-only.

Description
I kept running into this bug in a dm-rails app where explicit migrations could not resolve Property constants under Ruby 1.8.7, but work as expected under 1.9.2.
Steps to Reproduce
-
rails new dm-bug -m http://datamapper.org/templates/rails.rb
-
Add an explicit migration:
migration 1, :create_users do
up do
create_table :users do
column :id, Serial
column :name, String
column :bio, Text
end
end
down do
drop_table :users
end
end
-
rake db:migrate:up
Expected Results
- Ruby 1.9.2: Success
- Ruby 1.8.7: Success
Actual Results
- Ruby 1.9.2: Success
- Ruby 1.8.7:
$ rake db:migrate:up --trace
** Invoke db:migrate:up (first_time)
** Invoke db:migrate:load (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate:load
** Execute db:migrate:up
== Performing Up Migration #1: create_users
rake aborted!
uninitialized constant Serial
./db/migrate/001_create_users.rb:4:in `(root)'
/home/hal/.rvm/gems/jruby-1.6.4/gems/dm-migrations-1.1.0/lib/dm-migrations/sql/table_creator.rb:17:in `instance_eval'
/home/hal/.rvm/gems/jruby-1.6.4/gems/dm-migrations-1.1.0/lib/dm-migrations/sql/table_creator.rb:17:in `initialize'
/home/hal/.rvm/gems/jruby-1.6.4/gems/dm-migrations-1.1.0/lib/dm-migrations/migration.rb:142:in `create_table'
./db/migrate/001_create_users.rb:3:in `(root)'
I have successfully reproduced this bug under MRI 1.8.7 and JRuby 1.6.4.