From: Jamey Cribbs Date: 2005-10-24T19:30:10+09:00 Subject: Re: Madeleine, SQLite and multi-platform issues (in ruby :-) Assaph Mehr wrote: >Sounds like standard practice to my (inexperienced) mind. I was just >wondering if there was something like the ActiveRecord >#has_and_belong_to_many magic. > > > Unfortunately, no. That might be cool to have; I'll have to put that on the wishlist. :-) >OK, here's a specific example.: > >Suppose I had Foo with two fields :bar and :baz. The #kb_create had >those as parameters and KB passed them in as needed. > >Now version 2 has the same class Foo, but with the fields :baz and >:qux. I.e. one field was deleted and another was added. Their relative >'position' in the method arguments has also changed. Now if I send my >shiny new v2.0 to a user who has a smelly old v1 database, what will >happen? What do I need to do to respond, recover and/or upgrade the >existing database? > > Good question. Let's see. Well, since the fields are passed to #kb_create as positional arguments, that won't be good for the user still on v1.0. So, I guess you would have to include a conversion script that would: 1. #delete_table_column(:foo, :bar) 2. #add_table_column(:foo, :qux) 3. Include a new class defintion referring to :qux and not referring to :bar. Jamey Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments.