Difference between revisions of "User:Woozle/PostFerret/sql/post"
< User:Woozle | PostFerret | sql
Jump to navigation
Jump to search
(tweaks) |
(corrected table name in CREATE) |
||
Line 1: | Line 1: | ||
==About== | ==About== | ||
* '''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''': | ||
** '''ID_Owner''': ID of user who owns this atom. | ** '''ID_Owner''': ID of user who owns this atom. | ||
*** 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 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. | ||
− | |||
** '''URI''': I haven't yet decided if this really belongs here or how to formally define it, but it could be used for either: | ** '''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 | *** a page on the site which is set aside for more information about the given post | ||
Line 12: | Line 12: | ||
==SQL== | ==SQL== | ||
<mysql> | <mysql> | ||
− | CREATE TABLE ` | + | 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 sign 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 sign", |
Revision as of 17:52, 17 March 2013
About
- Purpose: an atom with a little bit of content and possibly an owner
- Fields:
- ID_Owner: ID of user who owns this atom.
- 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.
- 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
- ID_Owner: ID of user who owns this atom.
- History:
SQL
<mysql> CREATE TABLE `post` (
`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>