Difference between revisions of "User:Woozle/PostFerret/sql/text"
< User:Woozle | PostFerret | sql
Jump to navigation
Jump to search
(first draft) |
(removed ID; this is now a class (content type)) |
||
Line 1: | Line 1: | ||
==About== | ==About== | ||
− | * '''Purpose''': text records/revisions | + | * '''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. | ** 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''': | * '''History''': | ||
Line 7: | Line 7: | ||
<mysql> | <mysql> | ||
CREATE TABLE `pf_text` ( | 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", | `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", | `Revision` INT NOT NULL COMMENT "revision number for this record; does not change; must be one higher than previous record's", | ||
Line 13: | Line 13: | ||
`WhoSaved` INT DEFAULT NULL COMMENT "CMS-defined ID of who created this revision", | `WhoSaved` INT DEFAULT NULL COMMENT "CMS-defined ID of who created this revision", | ||
`Content` TEXT NOT NULL COMMENT "the actual text" | `Content` TEXT NOT NULL COMMENT "the actual text" | ||
− | PRIMARY KEY(` | + | PRIMARY KEY(`ID_Atom`) |
) | ) | ||
ENGINE = MYISAM; | ENGINE = MYISAM; |
Latest revision as of 01:55, 30 June 2015
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",