Difference between revisions of "User:Woozle/PostFerret/sql/post"
< User:Woozle | PostFerret | sql
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 | + | * '''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. | ||
− | + | ** '''2013-03-15''' Most fields moved from {{l/same|post}} to {{l/same|atom}}; added ID_Owner. | |
− | ** ''' | ||
− | |||
− | |||
==SQL== | ==SQL== | ||
<mysql> | <mysql> | ||
− | CREATE TABLE ` | + | CREATE TABLE `sign` ( |
− | `ID` | + | `ID_Atom` INT NOT NULL COMMENT "ID of atom this sign is using", |
− | `Summary` VARCHAR(255) NOT NULL COMMENT "short description | + | `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", |
− | + | `URI` VARCHAR(255) DEFAULT NULL COMMENT "optional site-relative URI for more information", | |
− | + | PRIMARY KEY(`ID_Atom`), | |
− | + | UNIQUE KEY `content` (`ID_Owner`,`Summary`) | |
− | |||
− | |||
− | PRIMARY KEY(` | ||
− | 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.
- ID_Owner: ID of user who owns this atom.
- 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
- URI: I haven't yet decided if this really belongs here, but it could be used for either:
- History:
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>