suren
suren

Reputation: 981

How to do database migration Rails3 + datamapper

I used dm-rails gem that allows datamapper to hook into rails-3 ,generated a scaffold and a migration file ,did rake db:migrate for database migration but nothing happens no error no migration, can any one suggest me how to run migrations with datamapper and rails-3.

Upvotes: 2

Views: 1164

Answers (1)

sparrovv
sparrovv

Reputation: 7784

You have to get dm-rails that add among other things, 2 specific rake tasks:

rake db:automigrate

it performs destructive automigration, so it checks if table exists, and if so then drop it, and create one more time. and

rake db:autoupgrade

It's upgrade your database schema to match your model properties.

Upvotes: 2

Related Questions