> #i think something wrong here, but don't know right way to do this
> class CreateCommentsComments < Sequel::Migration
>  def up
>    create_table :comments_comments do
>      primary_key :id
>      foreign_key :comment_id, :comments
>      foreign_key :parent_id, :comments
>    end
>  end
>  def down
>    drop_table :comments_comments
>  end
> end

Somebody may disagree with this, but this looks very much like an
"everything-is-an-association" taboo in database design (i.e. where
your relationship recursively defines the tuple).

I can't speak for Sequel migrations, but this is most certainly the
wrong way to design a commenting system in a RDBMS.  Okay, not "most
certainly", but 98% certainly.

You can make it work, but it will kill you with the terrible queries
you'll have to write.  Oh gosh, not to mention the insertions.

Todd

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to