Difference between revisions of "VbzCart/tables/cat titles"

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
(future notes)
(tidying)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==About==
 
==About==
 
* '''Purpose''': catalog titles within departments
 
* '''Purpose''': catalog titles within departments
* '''Future''': The design of this table will probably change some, as there deprecated fields to be removed (note that the extra complication of using the wiki for data must be balanced against the ease-of-editing and flexibility this allows)
+
* '''Related''': {{vbzcart/table|cat_depts}} (parent), {{vbzcart/table|cat_supp}} (parent)
 +
* '''Future''': The design of this table will probably change some, as there are deprecated fields to be removed
 
** Rename '''Desc''' to '''Descr''' because "Desc" is an SQL keyword
 
** Rename '''Desc''' to '''Descr''' because "Desc" is an SQL keyword
 
** Possibly another field specifically for text that appears in the Title's image(s) -- or should that be tied to the Images data?
 
** Possibly another field specifically for text that appears in the Title's image(s) -- or should that be tied to the Images data?
 
** Also possibly another field for an "alt=" description (what the thing actually looks like, in words)
 
** Also possibly another field for an "alt=" description (what the thing actually looks like, in words)
** '''ID_License''' should go with Images (earlier, was thinking this could be tracked as a Topic, but making it image-specific tentatively makes more sense)
+
** '''ID_License''' should go with Images (earlier, was thinking this could be tracked as a Topic, but making it image-specific makes more sense -- e.g. a photo of a model wearing a shirt should be licensed differently than the image of the pattern that goes on the shirt)
 +
==History==
 +
* '''2011-09-28''' adding '''ID_Supp''' field, making '''ID_Dept''' DEFAULT NULL (and optional)
 +
** The code doesn't know this yet, but it will get fixed as time permits.
 +
** Once the code is rewritten and any remaining Dept data is migrated to Topics, we can remove '''ID_Dept'''.
 +
* '''2016-01-17''' changed '''Notes''' from VARCHAR(255) to TEXT because notes, while rare, are sometimes long.
 +
** Eventually, Ferreteria will provide a wiki-like content management API...
 
==SQL==
 
==SQL==
<section begin=sql /><mysql> CREATE TABLE `cat_titles` (
+
<mysql> CREATE TABLE `cat_titles` (
   `ID` int(11) unsigned NOT NULL auto_increment,
+
   `ID`         int(11) unsigned     NOT NULL auto_increment,
   `Name` varchar(127),
+
   `Name`       varchar(127),
   `CatKey` varchar(63) NOT NULL,
+
   `CatKey`     varchar(63)         NOT NULL,
   `ID_Dept` int(11) unsigned NOT NULL default '0',
+
  `ID_Supp`    INT(11) UNSIGNED    NOT NULL COMMENT "cat_supp.ID",
   `ID_License` int(11) default NULL COMMENT "DEPRECATED",
+
   `ID_Dept`     int(11) UNSIGNED DEFAULT NULL COMMENT "cat_dept.ID (optional)",
   `DateAdded` datetime default NULL,
+
   `ID_License` int(11)         DEFAULT NULL COMMENT "DEPRECATED",
   `DateChecked` datetime default NULL COMMENT 'DEPRECATED',
+
   `DateAdded`   datetime         DEFAULT NULL,
   `DateUnavail` datetime default NULL,
+
   `DateChecked` datetime         DEFAULT NULL COMMENT 'DEPRECATED',
   `RstkMin` int(11) unsigned default NULL,
+
   `DateUnavail` datetime         DEFAULT NULL,
   `Supplier_CatNum` varchar(31),
+
   `RstkMin`     int(11) unsigned DEFAULT NULL COMMENT "minimum qty that can be ordered from supplier",
 +
   `Supplier_CatNum`     varchar(31) COMMENT "supplier's catalog # for this title",
 
   `Supplier_CatNum_Alt` varchar(31) COMMENT 'DEPRECATED',
 
   `Supplier_CatNum_Alt` varchar(31) COMMENT 'DEPRECATED',
   `Desc` tinytext COMMENT 'descriptive text for display on web - DEPRECATED (use wiki)',
+
   `Desc`       tinytext           COMMENT 'descriptive text for display on web - DEPRECATED (use wiki)',
   `Search` varchar(255) COMMENT 'additional keywords for searching, but not displayed',
+
   `Search`     varchar(255)       COMMENT 'additional keywords for searching, but not displayed',
   `Notes` varchar(255) COMMENT 'internal notes; not displayed or searched - DEPRECATED (use wiki)',
+
   `Notes`       TEXT                COMMENT 'internal notes; not displayed or searched - DEPRECATED (use wiki)',
 
   PRIMARY KEY(`ID`)
 
   PRIMARY KEY(`ID`)
 
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1;</mysql>
 
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1;</mysql>
<section end=sql />
 

Latest revision as of 19:04, 7 November 2016

About

  • Purpose: catalog titles within departments
  • Related:
  1. REDIRECT Template:l/vc/table (parent), cat_supp (parent)
  • Future: The design of this table will probably change some, as there are deprecated fields to be removed
    • Rename Desc to Descr because "Desc" is an SQL keyword
    • Possibly another field specifically for text that appears in the Title's image(s) -- or should that be tied to the Images data?
    • Also possibly another field for an "alt=" description (what the thing actually looks like, in words)
    • ID_License should go with Images (earlier, was thinking this could be tracked as a Topic, but making it image-specific makes more sense -- e.g. a photo of a model wearing a shirt should be licensed differently than the image of the pattern that goes on the shirt)

History

  • 2011-09-28 adding ID_Supp field, making ID_Dept DEFAULT NULL (and optional)
    • The code doesn't know this yet, but it will get fixed as time permits.
    • Once the code is rewritten and any remaining Dept data is migrated to Topics, we can remove ID_Dept.
  • 2016-01-17 changed Notes from VARCHAR(255) to TEXT because notes, while rare, are sometimes long.
    • Eventually, Ferreteria will provide a wiki-like content management API...

SQL

<mysql> CREATE TABLE `cat_titles` (

 `ID`          int(11) unsigned     NOT NULL auto_increment,
 `Name`        varchar(127),
 `CatKey`      varchar(63)          NOT NULL,
 `ID_Supp`     INT(11) UNSIGNED     NOT NULL COMMENT "cat_supp.ID",
 `ID_Dept`     int(11) UNSIGNED DEFAULT NULL COMMENT "cat_dept.ID (optional)",
 `ID_License`  int(11)          DEFAULT NULL COMMENT "DEPRECATED",
 `DateAdded`   datetime         DEFAULT NULL,
 `DateChecked` datetime         DEFAULT NULL COMMENT 'DEPRECATED',
 `DateUnavail` datetime         DEFAULT NULL,
 `RstkMin`     int(11) unsigned DEFAULT NULL COMMENT "minimum qty that can be ordered from supplier",
 `Supplier_CatNum`     varchar(31) COMMENT "supplier's catalog # for this title",
 `Supplier_CatNum_Alt` varchar(31) COMMENT 'DEPRECATED',
 `Desc`        tinytext            COMMENT 'descriptive text for display on web - DEPRECATED (use wiki)',
 `Search`      varchar(255)        COMMENT 'additional keywords for searching, but not displayed',
 `Notes`       TEXT                COMMENT 'internal notes; not displayed or searched - DEPRECATED (use wiki)',
 PRIMARY KEY(`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;</mysql>