Forum board example schema in YAML format - modify for Nested set?

Posted by takeshin on Stack Overflow See other posts from Stack Overflow or by takeshin
Published on 2010-03-15T10:42:09Z Indexed on 2010/03/15 12:39 UTC
Read the original article Hit count: 236

Filed under:
|
|
|
|

I have created a forum board app, based on YAML schema found in 'real world examples' of Doctrine Manual, which looks similar to this:

---
Forum_Category:
  columns:
    root_category_id: integer(10)
    parent_category_id: integer(10)
    name: string(50)
    description: string(99999)
  relations:
    Subcategory:
      class: Forum_Category
      local: parent_category_id
      foreign: id
    Rootcategory:
      class: Forum_Category
      local: root_category_id
      foreign: id

Forum_Board:
  columns:
    category_id: integer(10)
    name: string(100)
    description: string(5000)
  relations:
    Category:
      class: Forum_Category
      local: category_id
      foreign: id
    Threads:
      class: Forum_Thread
      local: id
      foreign: board_id

Forum_Entry:
  columns:
    author: string(50)
    topic: string(100)
    message: string(99999)
    parent_entry_id: integer(10)
    thread_id: integer(10)
    date: integer(10)
  relations:
    Parent:
      class: Forum_Entry
      local: parent_entry_id
      foreign: id
    Thread:
      class: Forum_Thread
      local: thread_id
      foreign: id

Forum_Thread:
  columns:
    board_id: integer(10)
    updated: integer(10)
    closed: integer(1)
  relations:
    Board:
      class: Forum_Board
      local: board_id
      foreign: id
    Entries:
      class: Forum_Entry
      local: id
      foreign: thread_id

How to modify this schema, to use NestedSet (Tree structure of threads and entries)?

© Stack Overflow or respective owner

Related posts about doctrine

Related posts about yaml