Skip to content

Placement Table Reference

mikert edited this page Feb 16, 2011 · 1 revision

Placement Table Reference

Purpose

This is a lookup table that allows a one-to-many relationship between mt_entry and mt_category.

Associated Perl classes

  • MT::Placement

Fields

  • placement_id - integer not null auto_increment. - The primary key of the placement table.
  • placement_blog_id - integer not null. - The blog associated with the placement. Should always be the same as the category's blog ID.
  • placement_entry_id - integer not null. - The entry associated with the category.
  • placement_category_id - integer not null. - The category associated with the entry.
  • placement_is_primary - boolean not null. - A flag that shows whether or not the category associated here is the primary category for the entry.

Indexes

  • mt_placement_blog_id
  • mt_placement_entry_id
  • mt_placement_category_id
  • mt_placement_is_primary
  • mt_placement_blog_cat - columns:
    • blog_id
    • category_id

SQL example

SELECT 
    entry_title
    FROM mt_entry e 
    JOIN mt_placement p ON e.entry_id = p.placement_entry_id
    JOIN mt_category c ON c.category_id = p.placement_category_id 
    AND c.category_label LIKE 'Melody%'
Clone this wiki locally