From: Assaph Mehr Date: 2005-10-24T14:04:50+09:00 Subject: Re: Madeleine, SQLite and multi-platform issues (in ruby :-) > >So how are many-to-many relationshops handled (e.g. authors and books)? > > > Hmm, let me think about this. I guess I would create an author table, a > book table, and a book_author table in the middle that would link the > two. I think that would work for a many-to-many. 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. > >Also, how well does KB deal with "schema" changes between revisions? I > >mean a new class version vs old data-store - how do I handle old > >record data vs. new fields? > > > > > You are free to modify the record class as much as you want. KirbyBase > is going to pass in the field values to the #kb_create method. After > that, it is up to you to do with them what you will. 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? Cheers, Assaph