Difference between revisions of "VbzCart/tables/ctg 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
(note about ID_Title)
(removing and renaming)
Line 3: Line 3:
 
* '''Future''': Rename '''ID_Title''' field to '''ID_LCTitle''', for disambiguation. Maybe ID_Group and ID_Source should be ID_SCGroup and ID_SCSource, for consistency.
 
* '''Future''': Rename '''ID_Title''' field to '''ID_LCTitle''', for disambiguation. Maybe ID_Group and ID_Source should be ID_SCGroup and ID_SCSource, for consistency.
 
==Fields==
 
==Fields==
* '''ID_Title''': at this point (2016-01-31), I'm actually mystified as to what this field is actually for. Documentation says it refers to cat_titles, but I can't think why or how it gets set.
+
* '''ID_Title''': When the build process results in creating a new LC Title, this gets filled in with the Title's ID in order to prevent duplicates. If this field is NULL, then the Title is ''probably'' new, unless we have created LC Titles directly before entering them from the catalog. (Currently working out how to efficiently check for possible duplicates before creating new LC Titles.)
 +
* '''Code''': Still reconstructing what this is for.
 +
* '''Descr''': Still reconstructing what this is for. Documentation said "required if Code is used", but it is often NULL when Code is not NULL -- so changing that to "recommended if Code is used".
 +
==History==
 +
* '''2016-02-04'''
 +
** Removing '''GroupSort''' -- I'm still figuring out how the former Group* fields are supposed to be used, and GroupSort is NULL in all existing records. If it's ever needed, document how it is supposed to work.
 +
** Renaming '''GroupCode''' and '''GroupDescr''' to '''Code''' and '''Descr''' to be consistent with naming in {{l/vc/table|ctg_groups}}.
 
==SQL==
 
==SQL==
 
<mysql>CREATE TABLE `ctg_titles` (
 
<mysql>CREATE TABLE `ctg_titles` (
Line 11: Line 17:
 
   ID_Source  INT DEFAULT NULL COMMENT "ctg_sources.ID - source which enables this selection",
 
   ID_Source  INT DEFAULT NULL COMMENT "ctg_sources.ID - source which enables this selection",
 
   WhenDiscont DATETIME DEFAULT NULL COMMENT "non-sourced discontinuation",
 
   WhenDiscont DATETIME DEFAULT NULL COMMENT "non-sourced discontinuation",
   GroupCode   VARCHAR(7) DEFAULT NULL COMMENT "catalog code extension for this title group (optional)",
+
   Code   VARCHAR(7) DEFAULT NULL COMMENT "optional catalog code extension",
   GroupDescr VARCHAR(127) DEFAULT NULL COMMENT "description extension for this title group (required if GroupCode is used)",
+
   Descr VARCHAR(127) DEFAULT NULL COMMENT "description extension (recommended if Code is used)",
  GroupSort  VARCHAR(7) DEFAULT NULL COMMENT "sorting override",
 
 
   isActive    BOOL DEFAULT FALSE COMMENT "this group-title membership is active?",
 
   isActive    BOOL DEFAULT FALSE COMMENT "this group-title membership is active?",
 
   Supp_CatNum VARCHAR(15) DEFAULT NULL COMMENT "catalog # for restock from supplier",
 
   Supp_CatNum VARCHAR(15) DEFAULT NULL COMMENT "catalog # for restock from supplier",

Revision as of 14:31, 4 February 2016

About

  • Purpose: Specifies which groups a SC title belongs to
  • Future: Rename ID_Title field to ID_LCTitle, for disambiguation. Maybe ID_Group and ID_Source should be ID_SCGroup and ID_SCSource, for consistency.

Fields

  • ID_Title: When the build process results in creating a new LC Title, this gets filled in with the Title's ID in order to prevent duplicates. If this field is NULL, then the Title is probably new, unless we have created LC Titles directly before entering them from the catalog. (Currently working out how to efficiently check for possible duplicates before creating new LC Titles.)
  • Code: Still reconstructing what this is for.
  • Descr: Still reconstructing what this is for. Documentation said "required if Code is used", but it is often NULL when Code is not NULL -- so changing that to "recommended if Code is used".

History

  • 2016-02-04
    • Removing GroupSort -- I'm still figuring out how the former Group* fields are supposed to be used, and GroupSort is NULL in all existing records. If it's ever needed, document how it is supposed to work.
    • Renaming GroupCode and GroupDescr to Code and Descr to be consistent with naming in ctg_groups.

SQL

<mysql>CREATE TABLE `ctg_titles` (

 ID          INT NOT NULL AUTO_INCREMENT,
 ID_Title    INT DEFAULT NULL COMMENT "cat_titles.ID",
 ID_Group    INT DEFAULT NULL COMMENT "ctg_groups.ID",
 ID_Source  INT DEFAULT NULL COMMENT "ctg_sources.ID - source which enables this selection",
 WhenDiscont DATETIME DEFAULT NULL COMMENT "non-sourced discontinuation",
 Code   VARCHAR(7) DEFAULT NULL COMMENT "optional catalog code extension",
 Descr  VARCHAR(127) DEFAULT NULL COMMENT "description extension (recommended if Code is used)",
 isActive    BOOL DEFAULT FALSE COMMENT "this group-title membership is active?",
 Supp_CatNum VARCHAR(15) DEFAULT NULL COMMENT "catalog # for restock from supplier",
 Notes       VARCHAR(255) DEFAULT NULL COMMENT "notes about this particular title's availability in this group",
 PRIMARY KEY(`ID`)

) ENGINE = MYISAM;</mysql>