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

Description
Given an initial model Foo:
class Rekenservice
include DataMapper::Resource
property :prop1, Integer
end
We perform a rake db:setup && rake db:migrate and all is fine. Now later in development we add a new
property to our column :prop2.
class Rekenservice
include DataMapper::Resource
property :prop1, Integer
property :prop2, Integer
end
We write a migration for this that reads as follows:
migration 1, :add_prop2 do
up do
modify_table :foos do
add_column :prop2, Integer
end
end
end
Subsequently calling rake db:migrate is no problem. However, now when we run rake db:setup && rake db:migrate again after deleting our database we get the following error:
duplicate column name: prop2
This because auto_migrate! in rake db:setup already created the column for :prop2.
What to do about this?