User:Woozle/PostFerret/sql/post

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< User:Woozle‎ | PostFerret‎ | sql
Revision as of 20:49, 15 March 2013 by Woozle (talk | contribs)
Jump to navigation Jump to search

About

  • Purpose: an atom with a little bit of content and possibly an owner
    • ID_Owner: ID of user who owns this atom.
      • Some sign types will not have owners, but this needs to be here so it can be part of the unique key. We don't want to prevent different users from using the same Summary.
  • Fields:
    • URI: I haven't yet decided if this really belongs here, but it could be used for either:
      • a page on the site which is set aside for more information about the given post
      • the post's official URI on the site
  • History:
    • 2013-03-12 Created, but not yet in use.
    • 2013-03-15 Most fields moved from post to atom; added ID_Owner.

SQL

<mysql> CREATE TABLE `sign` (

  `ID_Atom`     INT              NOT NULL COMMENT "ID of atom this sign is using",
  `ID_Owner`    INT              NOT NULL COMMENT "optional: ID of user who owns this sign",
  `Summary`     VARCHAR(255)     NOT NULL COMMENT "short description, for listings",
  `URI`         VARCHAR(255) DEFAULT NULL COMMENT "optional site-relative URI for more information",
  PRIMARY KEY(`ID_Atom`),
  UNIQUE KEY `content` (`ID_Owner`,`Summary`)
)
ENGINE = MYISAM;

</mysql>