Difference between revisions of "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
Jump to navigation Jump to search
m (Woozle moved page PostFerret/sql to PostFerret/sql/post without leaving a redirect: ...duhhh...)
Line 1: Line 1:
 
==About==
 
==About==
* '''Purpose''': a trackable piece of text (can be modified, has edit history, etc.)
+
* '''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''':
 
* '''History''':
 
** '''2013-03-12''' Created, but not yet in use.
 
** '''2013-03-12''' Created, but not yet in use.
* '''Fields''':
+
** '''2013-03-15''' Most fields moved from {{l/same|post}} to {{l/same|atom}}; added ID_Owner.
** '''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
 
 
==SQL==
 
==SQL==
 
<mysql>
 
<mysql>
CREATE TABLE `post` (
+
CREATE TABLE `sign` (
   `ID`         INT         NOT NULL AUTO_INCREMENT,
+
   `ID_Atom`    INT              NOT NULL COMMENT "ID of atom this sign is using",
   `Summary`    VARCHAR(255)    NOT NULL COMMENT "short description of post, for listings",
+
  `ID_Owner`   INT             NOT NULL COMMENT "optional: ID of user who owns this sign",
   `URI`        VARCHAR(255) DEFAULT NULL COMMENT "site-relative URI for more information",
+
   `Summary`    VARCHAR(255)    NOT NULL COMMENT "short description, for listings",
  `WhenCreated` DATETIME        NOT NULL COMMENT "when this question was entered",
+
   `URI`        VARCHAR(255) DEFAULT NULL COMMENT "optional site-relative URI for more information",
  `WhoCreated`  INT              NOT NULL COMMENT "ID (site-defined) of user who added the question",
+
   PRIMARY KEY(`ID_Atom`),
  `WhenEdited`  DATETIME    DEFAULT NULL COMMENT "when this question was last edited",
+
   UNIQUE KEY `content` (`ID_Owner`,`Summary`)
  `WhoEdited`  INT          DEFAULT NULL COMMENT "ID of user who last edited the question",
 
  `QtyEdits`    INT          DEFAULT NULL COMMENT "number of times this question has been edited",
 
   PRIMARY KEY(`ID`),
 
   UNIQUE KEY `content` (`Summary`)
 
 
  )
 
  )
 
  ENGINE = MYISAM;
 
  ENGINE = MYISAM;
 
</mysql>
 
</mysql>

Revision as of 20:49, 15 March 2013

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>