2012/5/9 James B. Byrne <[email protected]>: > > On Wed, May 9, 2012 13:35, Maurizio Casimirri wrote: > >> >> Migrations are meaningless outside active record (again the pattern >> not the gem).. we can't enforce a migration centered approach in an >> ORM agnostic environment.. perhaps to me it seems that is more >> comfortable to make ActiveRecord to support properties inside models >> that to ask Mongoid and other 500 ORMs around to dump fields and >> support migrations. >
> This statement is not factual. Migrations, in the sense of being any > systematic method of aggregating changes to a database schema over > time and generating the necessary DDL, certainly can possess meaning > outside of whatever method of data representation (AR, DM, IM, QO, ad > nauseam) is chosen by an OO system designer. > Yes, this is true, i was trying to say that rely on migrations to achieve ORM-agnostic model needs to rely on the fact that all the ORMs around should use them, or em I wrong? > It is entirely conceivable that two or more separate projects > employing AR (the pattern) could reference the same database and table > and each consider only the subset of the schema necessary for their > specific function. In such a case, under your proposal, which > implementation should provide the migration? > The same way is provided now. My current implementation is conservative over the AR migration system, so no problem here. I don't want drop migrations for a better system. But I understand probably here can be a tricky part: User (App a) name User (App b) name Now say that we want to add "age" to User for the app B. Here we could add the property on the model and safely run the migration generator. The migration generator will take into account the current state of the database, so no problem here until you don't want it to support also irreversible changes, a bad idea for me. The only case in which the generator fails to generate is when the state of the database is not updated respect to migrations, but no problem arises if we use two different models refering to same table, only the differences will be taken into account. Was this your question? Regards Maurizio > > -- > *** E-Mail is NOT a SECURE channel *** > James B. Byrne mailto:[email protected] > Harte & Lyne Limited http://www.harte-lyne.ca > 9 Brockley Drive vox: +1 905 561 1241 > Hamilton, Ontario fax: +1 905 561 0757 > Canada L8E 3C3 > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
