Skip to content

Entry Table Reference

mikert edited this page Feb 19, 2011 · 1 revision

Entry Table Reference

Associated Perl classes

  • MT::Entry
  • MT::Page

Fields

  • entry_id - int(11). - The entry table's primary key.
  • entry_allow_comments - tinyint(4). - A flag which controls whether or not comments are allowed on this entry.
  • entry_allow_pings - tinyint(4). - A flag that controls whether or not pings are allowed on this entry.
  • entry_atom_id - varchar(255). - The Atom ID for this field. This is an example value: tag:www.domain.com,2011://2.16648
  • entry_author_id - int(11). - The user who created the entry; same as created_on.
  • entry_authored_on - datetime . - The date and time when this entry was set to be published.
  • entry_basename - varchar(255). - The normalized title of the entry (by default). This is used in URL construction.
  • entry_blog_id - int(11). - The entry's blog.
  • entry_category_id - int(11). - The ID of the primary category; treat this as though it's deprecated
  • entry_class - varchar(255). - The type of the record.
    • entry - Declares this to be an entry object.
    • page - Declares this to be a page object.
  • entry_comment_count - int(11). - The number of comments on this entry.
  • entry_convert_breaks - varchar(30). - The way that the text fields (body, more and excerpt) will be processed. Values are:
    • none
    • convert_breaks
    • markdown
    • markdown_with_smartypants
    • richtext
  • entry_created_by - int(11). - The user who created the entry.
  • entry_created_on - datetime. - The time when the entry was actually entered into the database.
  • entry_excerpt - mediumtext. - A blurb of text that acts as an excerpt for the whole entry.
  • entry_keywords - mediumtext. - A comma-delimited list of keywords. This should be ignored in favor of using tags.
  • entry_modified_by - int(11). - The user who last modified this entry.
  • entry_modified_on - datetime. - When this entry was last modified.
  • entry_ping_count - int(11). - The number of trackback pings this entry has received.
  • entry_pinged_urls - mediumtext. - The URLs that have already received trackback pings.
  • entry_status - smallint(6). - The status of this entry's publication. Valid values are the following:
    • 1 - Hold
    • 2 - Release
    • 3 - Review
    • 4 - Future
    • 5 - Junk
  • entry_tangent_cache - mediumtext. - TODO
  • entry_template_id - int(11). - TODO
  • entry_text - mediumtext. - The main text area of the entry.
  • entry_text_more - mediumtext. - The text of the entry that is shown by the EntryMore tag.
  • entry_title - varchar(255). - The title of the entry.
  • entry_to_ping_urls - mediumtext. - A list of URLs to ping when the entry is published.
  • entry_week_number - int(11). - A pseudo-timestamp that looks like "201103" for "year 2011, week #3."
  • entry_current_revision - int(11). - A field for tracking which entry in the revision table is the latest version.

Indexes

  • mt_entry_status
  • mt_entry_author_id
  • mt_entry_created_on
  • mt_entry_modified_on
  • mt_entry_comment_count
  • mt_entry_auth_stat_class
    • columns
      • entry_author_id
      • entry_status
      • entry_class
  • mt_entry_blog_basename
    • columns
      • entry_blog_id
      • entry_basename
  • mt_entry_title
    • Page listings are published in order by title
  • mt_entry_blog_author
    • columns
      • entry_blog_id
      • entry_class
      • entry_author_id
      • authored_on
  • mt_entry_blog_week
    • columns
      • entry_blog_id
      • entry_class
      • entry_status
      • entry_week_number
  • mt_entry_class_authored
    • columns
      • entry_class
      • entry_authored_on
    • For system-overview listings where we list all entries of a particular class by authored on date
  • mt_entry_class_authored
  • mt_entry_blog_authored
    • columns
      • entry_blog_id
      • entry_class
      • entry_authored_on
    • For most blog-level listings, where we list all entries in a blog with a particular class by authored on date.
  • mt_entry_blog_stat_date
    • columns
      • entry_blog_id
      • entry_class
      • entry_status
      • entry_authored_on
      • entry_id
    • For most publishing listings, where we list entries in a blog with a particular class, publish status (2) and authored on date
  • mt_entry_dd_entry_tag_count
    • columns
      • entry_blog_id
      • entry_status
      • entry_class
      • entry_id
  • mt_entry_tag_count
    • columns
      • entry_status
      • entry_class
      • entry_blog_id
      • entry_id
    • For tag count

SQL Examples

Look Up Comments For An Entry

SELECT
    *
FROM
    mt_comment
WHERE
    comment_entry_id = ?

Find All Categories For An Entry

SELECT
    category_label
FROM
    mt_category cat
JOIN
    mt_placement p
ON
    cat.category_id = p.placement_category_id
AND
    p.placement_entry_id = ?

Find All Tags For An Entry

SELECT
    tag_name
FROM
    mt_tag t
JOIN
    mt_objecttag o
ON
    t.tag_id = o.objecttag_tag_id
AND
    o.objecttag_object_datasource = 'entry'
AND
    o.objecttag_object_id = ?

Find All Assets Associated With An Entry

SELECT
    asset_label,
    asset_url
FROM
    mt_asset asset
JOIN
    mt_objectasset oa
ON
    asset.asset_id = oa.objectasset_asset_id
AND
    oa.objectasset_object_ds = 'entry'
AND
    oa.objectasset_object_id = ?
Clone this wiki locally