-
Website
http://blog.new-bamboo.co.uk -
Original page
http://blog.new-bamboo.co.uk/2008/1/16/activerecord-datamapper -
Subscribe
All Comments -
Community
-
Top Commenters
-
TomK32
1 comment · 1 points
-
-
Popular Threads
@Carl, I believe that a property defines an attribute, its type and the default value.
As for ActiveRecord, well i've had my ups and downs with that. The distinction between Model and the Migration was a bit annoying.
For example, when manipulating my schema via the Migration, i often had the associated Model break. Which is great if you are on the previous version, but the more versions behind you are, the more things can go wrong when upgrading - especially if you rely on methods in your models, or you decide to use another database and find that what worked in MySQL in version 1 totally barfs up with SQLite.
IMO, DataMapper is doing the right thing by sticking the schema in along with the model. That way i can think of versioning the Model as a whole.
@Matt + @thomas - I'm pretty sure the classic migrations aren't destructive (well they can be if so wished, or I might have misunderstood:)). A DM migration is just a class that inherits DataMapper::Migration in a similar way to Rails migrations. You can manipulate and change your schema/data anyway you wish in the 'up' and 'down' methods just like you can in Rails. Is this what you mean?
Cheers my dears
Jonathan
DataMapper::Base.auto_migrate!
has been changed into this:
DataMapper::Persistence.auto_migrate!
Cheers!