On Aug 9, 12:46 am, Jeremy Evans <[email protected]> wrote: > On Aug 7, 9:25 pm, russm <[email protected]> wrote: > > > So, first, is there any way of specifying a foreign_key that's neither > > an integer nor a composite key? At the moment I'm using the composite > > foreign key syntax but specifying only the single UUID column :id in > > the keys array - this appears to work but seems a bit unpleasant. > > Yes: > > foreign_key :column, :table, :type=>:uuid
ah, OK, I was misled by the unconditional column(name, Integer, opts) at lib/sequel/database/schema_generator.rb:139 > > With the CTI plugin, do the child classes need to be specified in the > > table map? I'd rather not have to push knowledge about the class > > hierarchy up into the top level class. > > It's only necessary if the implicit table names do not match the > database table names. Because using set_dataset in subclasses would > screw up the plugin, you must set the table name in the :table_map so > that the plugin can assign the correct table name. is there a technical reason for this, or is it just a "nobody has bothered to do it yet" thing? would you accept a patch to smarten it up? off the top of my head I'm thinking of something like defining self.inherited() on classes that include the CTI plugin to patch set_dataset in inheriting classes such that it climbs the class hierarchy and updates the table_map in the root class. cheers Russell -- You received this message because you are subscribed to the Google Groups "sequel-talk" 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/sequel-talk?hl=en.
