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
(corrected table name in CREATE)
(revisions)
Line 2: Line 2:
 
* '''Purpose''': an atom with a little bit of content and possibly an owner
 
* '''Purpose''': an atom with a little bit of content and possibly an owner
 
* '''Fields''':
 
* '''Fields''':
** '''ID_Owner''': ID of user who owns this atom.
+
** '''ID_Owner''': ID of user who owns this post
*** Some post 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.
+
*** Some post types will not have owners, but it's a common enough thing that I thought it should go in at a low level.
** '''URI''': I haven't yet decided if this really belongs here or how to formally define it, 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.
 
** '''2013-03-15''' Most fields moved from {{l/same|post}} to {{l/same|atom}}; added ID_Owner.
 
** '''2013-03-15''' Most fields moved from {{l/same|post}} to {{l/same|atom}}; added ID_Owner.
 +
** '''2013-06-28'''
 +
*** Decided to remove '''URI''' until there's a clear purpose and need for it.
 +
*** Removed owner/summary uniqueness requirement; can't see need for this either (e.g. multiple posts might be called "status report", for example).
 +
*** Added '''Body''' field to make this independent of the containing [[content management system|CMS]].
 
==SQL==
 
==SQL==
 
<mysql>
 
<mysql>
 
CREATE TABLE `post` (
 
CREATE TABLE `post` (
   `ID_Atom`    INT              NOT NULL COMMENT "ID of atom this sign is using",
+
   `ID_Atom`    INT              NOT NULL COMMENT "ID of atom this post is using",
   `ID_Owner`    INT              NOT NULL COMMENT "optional: ID of user who owns this sign",
+
   `ID_Owner`    INT              NOT NULL COMMENT "optional: ID of user who owns this post",
 
   `Summary`    VARCHAR(255)    NOT NULL COMMENT "short description, for listings",
 
   `Summary`    VARCHAR(255)    NOT NULL COMMENT "short description, for listings",
   `URI`         VARCHAR(255) DEFAULT NULL COMMENT "optional site-relative URI for more information",
+
   `Body`       TEXT            DEFAULT NULL COMMENT "body of post (optional)",
 
   PRIMARY KEY(`ID_Atom`),
 
   PRIMARY KEY(`ID_Atom`),
  UNIQUE KEY `content` (`ID_Owner`,`Summary`)
 
 
  )
 
  )
 
  ENGINE = MYISAM;
 
  ENGINE = MYISAM;
 
</mysql>
 
</mysql>
 +
==Obsolete==
 +
* '''URI''': I haven't yet decided if this really belongs here or how to formally define it, 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
 +
<mysql>  `URI`        VARCHAR(255) DEFAULT NULL COMMENT "optional site-relative URI for more information",</mysql>

Revision as of 21:37, 28 June 2013

About

  • Purpose: an atom with a little bit of content and possibly an owner
  • Fields:
    • ID_Owner: ID of user who owns this post
      • Some post types will not have owners, but it's a common enough thing that I thought it should go in at a low level.
  • History:
    • 2013-03-12 Created, but not yet in use.
    • 2013-03-15 Most fields moved from post to atom; added ID_Owner.
    • 2013-06-28
      • Decided to remove URI until there's a clear purpose and need for it.
      • Removed owner/summary uniqueness requirement; can't see need for this either (e.g. multiple posts might be called "status report", for example).
      • Added Body field to make this independent of the containing CMS.

SQL

<mysql> CREATE TABLE `post` (

  `ID_Atom`     INT              NOT NULL COMMENT "ID of atom this post is using",
  `ID_Owner`    INT              NOT NULL COMMENT "optional: ID of user who owns this post",
  `Summary`     VARCHAR(255)     NOT NULL COMMENT "short description, for listings",
  `Body`        TEXT             DEFAULT NULL COMMENT "body of post (optional)",
  PRIMARY KEY(`ID_Atom`),
)
ENGINE = MYISAM;

</mysql>

Obsolete

  • URI: I haven't yet decided if this really belongs here or how to formally define it, 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

<mysql> `URI` VARCHAR(255) DEFAULT NULL COMMENT "optional site-relative URI for more information",</mysql>