VbzCart/docs/tables/cat ittyps: Difference between revisions
Jump to navigation
Jump to search
imported>Woozle (extracted from "tables" page) |
imported>Woozle m (removed "section" tags) |
||
Line 10: | Line 10: | ||
** '''isType''' (flag): if TRUE, this type may be used for actual items; if not, it is a folder (type category) | ** '''isType''' (flag): if TRUE, this type may be used for actual items; if not, it is a folder (type category) | ||
==SQL== | ==SQL== | ||
<mysql> DROP TABLE IF EXISTS `cat_ittyps`; | |||
CREATE TABLE `cat_ittyps` ( | CREATE TABLE `cat_ittyps` ( | ||
`ID` INT NOT NULL AUTO_INCREMENT, | `ID` INT NOT NULL AUTO_INCREMENT, | ||
Line 21: | Line 21: | ||
PRIMARY KEY(`ID`) | PRIMARY KEY(`ID`) | ||
) ENGINE = MYISAM;</mysql> | ) ENGINE = MYISAM;</mysql> | ||
Revision as of 15:25, 15 March 2013
About
- Purpose: catalog item types - every item has one, but they are often all the same
- Fields:
- ID_Parent (int): Template:Vbzcart/table.ID of parent, if any
- NameSng (string): word for single item of this type (e.g. "shirt","box")
- NamePlr (string): word for multiple items of this type (e.g. "shirts","boxes")
- Descr (string): longer name, e.g. "compact disc" instead of "CD". If blank, use NameSng.
- Q: should this contain plural text? Or will we need DescrSng and DescrPlr?
- Sort (string): sorting key (optional)
- isType (flag): if TRUE, this type may be used for actual items; if not, it is a folder (type category)
SQL
<mysql> DROP TABLE IF EXISTS `cat_ittyps`;
CREATE TABLE `cat_ittyps` ( `ID` INT NOT NULL AUTO_INCREMENT, `ID_Parent` INT COMMENT '(self).ID of parent type; mainly for organizational purposes', `NameSng` varchar(63) NOT NULL COMMENT 'word for single item of this type (e.g. "shirt", "box")', `NamePlr` varchar(63) COMMENT 'word for multiple items of this type (e.g. "shirts", "boxes"); NULL = use singular', `Descr` varchar(255) COMMENT 'longer name (singular), e.g. "compact disc" instead of "CD". NULL = use singular', `Sort` varchar(31) COMMENT "optional sorting key", `isType` BOOL COMMENT 'FALSE = just a folder, so omit it from drop-down lists of types to choose from', PRIMARY KEY(`ID`) ) ENGINE = MYISAM;</mysql>