User:Woozle/PostFerret/sql/text

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to: navigation, search

About

  • Purpose: content type -- text records/revisions
    • For now all revisions go in the same table; later, we should probably move old revisions into an archive so they don't slow down access to the ones currently in use.
  • History:
    • 2015-06-29 first draft

SQL

<mysql> CREATE TABLE `pf_text` (

  `ID_Atom`          INT NOT NULL COMMENT "Atom used by this record",
  `ID_Prev`          INT NOT NULL COMMENT "ID of previous revision; if none, must equal self.ID",
  `Revision`         INT NOT NULL COMMENT "revision number for this record; does not change; must be one higher than previous record's",
  `WhenSaved`   DATETIME NOT NULL COMMENT "when this revision was created",
  `WhoSaved`     INT DEFAULT NULL COMMENT "CMS-defined ID of who created this revision",
  `Content`         TEXT NOT NULL COMMENT "the actual text"
  PRIMARY KEY(`ID_Atom`)
)

ENGINE = MYISAM; </mysql>

Not Used

  `ID_Atom`     INT              NOT NULL COMMENT "ID of atom to which this text belongs",