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

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
(changes - +ID_Folder, -WebSpec)
(→‎History: removed "WebSpec OLD")
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==About==
 
==About==
 
* '''Purpose''': Stores data for images relevant to displaying catalog entities (currently only Titles)
 
* '''Purpose''': Stores data for images relevant to displaying catalog entities (currently only Titles)
* '''History''':
+
==History==
** '''2010-11-15'''
+
* '''2010-11-15'''
*** Added ID_Folder to allow use of different base URLs via {{vbzcart|table|cat_folders}}.
+
** Added ID_Folder to allow use of different base URLs via {{vbzcart|table|cat_folders}}.
*** Removed WebSpec because nothing was using it and some of the data was missing and all of it used DOS-style paths.
+
** Removed WebSpec because nothing was using it and some of the data was missing and all of it used DOS-style paths.
* '''Fields''':
+
*** Description of WebSpec field was: should be considered the official location for the purposes of page display; only image admin functions should update it.
** '''Spec''' can either be the official location of the file or can be updated from [[FileFerret]] using the IDFF data. It should eventually be renamed to something like LocalSpec, StorSpec, SrcSpec...
+
* '''2010-11-16''' Added '''WhenAdded''' and '''WhenEdited''' fields because... well, it's easy to do, and provides a secondary check against the event log.
** '''WebSpec''' should be considered the official location for the purposes of page display; only image admin functions should update it.
+
* '''2016-01-25''' Added '''CatKey''' field as part of getting rid of {{l/same|cat_pages}}.
** [[FileFerret]] columns:
+
** Also finally removed '''WebSpec OLD''' from the actual data (was probably just a rename of WebSpec in 2010 in case removing it turned out to be a bad idea).
*** '''IDFF_File''' should always be set; this way, the file can be located if it gets moved. NOT NULL isn't required, though, because it may be necessary to find the file first and later request a FileFerret ID for it.
+
 
*** '''IDFF_Fideal''' is set opportunistically, for now. Later on we may want to have a policy that all VbzCart images should have a Fideal, but this will be determined as FileFerret is worked out.
+
==Fields==
* '''Future''': I had boldly planned to use [[FileFerret]] to manage image files, and towards that end had boldly removed any actual filespec information from this table, but then later realized that this was placing too much tight dependency on another entire subsystem. Eventually the filespec fields need to be restored and FileFerret should be relegated to keeping them updated if things are moved.
+
* '''CatKey''' is much like CatKey in every other type of record, i.e. it defines part of the URL -- in this case, the part after the Title. The value should be the same as updating all records with the following SQL: <mysql>CatKey=CONCAT_WS("-",Ab_Size,AttrFldr)</mysql>
 +
* '''Spec''' (filesystem spec) can either be the official location of the file or can be updated from [[FileFerret]] using the IDFF data. It should eventually be renamed to something like FilePath, LocalSpec, StorSpec, SrcSpec...
 +
* [[FileFerret]] columns:
 +
** '''IDFF_File''' should always be set; this way, the file can be located if it gets moved. NOT NULL isn't required, though, because it may be necessary to find the file first and later request a FileFerret ID for it.
 +
** '''IDFF_Fideal''' is set opportunistically, for now. Later on we may want to have a policy that all VbzCart images should have a Fideal, but this will be determined as FileFerret is worked out.
 +
==Future==
 +
'''Spec''' should probably be renamed to something more specific like FilePath.
 +
 
 +
I had boldly planned to use [[FileFerret]] to manage image files, and towards that end had boldly removed any actual filespec information from this table, but then later realized that this was placing too much tight dependency on another entire subsystem. Maybe FileFerret should be responsible for keeping track of apps that use it, and for notifying them if any of their files are moved.
 
==SQL==
 
==SQL==
<section begin=sql /><mysql> CREATE TABLE `cat_images` (
+
<mysql> CREATE TABLE `cat_images` (
   ID                 INT NOT NULL AUTO_INCREMENT,
+
   ID                 INT NOT NULL AUTO_INCREMENT,
   isActive         BOOL NOT NULL DEFAULT FALSE,
+
   isActive           BOOL NOT NULL DEFAULT FALSE,
   ID_Folder         INT NOT NULL COMMENT "base folder to which the Spec is relative",
+
  CatKey    VARCHAR(63) DEFAULT NULL COMMENT "change to NOT NULL after populating",
   Spec      VARCHAR(255) NOT NULL COMMENT "relative filespec for accessing image file",
+
   ID_Folder           INT NOT NULL COMMENT "base folder to which the Spec is relative",
   ID_Title           INT NOT NULL COMMENT "titles.ID of title to which this image applies",
+
   Spec      VARCHAR(255) NOT NULL COMMENT "relative filespec for accessing image file",
   Ab_Size  VARCHAR(7)           COMMENT "ImgSizes.Ab: abbreviation for image size class",
+
   ID_Title           INT NOT NULL COMMENT "titles.ID of title to which this image applies",
   AttrFldr  VARCHAR(15)           COMMENT "folder (key) name for images with this attribute",
+
   Ab_Size  VARCHAR(7)             COMMENT "ImgSizes.Ab: abbreviation for image size class",
   AttrDispl VARCHAR(64)           COMMENT "description to display (e.g. in image tooltip) for this attribute",
+
   AttrFldr  VARCHAR(15)           COMMENT "folder (key) name for images with this attribute",
   AttrSort  VARCHAR(15)           COMMENT "sorting order for this attribute",
+
   AttrDispl VARCHAR(64)           COMMENT "description to display (e.g. in image tooltip) for this attribute",
   IDFF_File     INT DEFAULT NULL COMMENT "FileFerret.Files.ID",
+
   AttrSort  VARCHAR(15)           COMMENT "sorting order for this attribute",
   IDFF_Fideal   INT DEFAULT NULL COMMENT "FileFerret.Fideals.ID",
+
  WhenAdded  DATETIME DEFAULT NULL COMMENT "when this record was created",
 +
  WhenEdited DATETIME DEFAULT NULL COMMENT "when this record was last updated",
 +
   IDFF_File       INT DEFAULT NULL COMMENT "FileFerret.Files.ID",
 +
   IDFF_Fideal     INT DEFAULT NULL COMMENT "FileFerret.Fideals.ID",
 
   PRIMARY KEY(`ID`)
 
   PRIMARY KEY(`ID`)
 
  )
 
  )
 
  ENGINE = MYISAM;</mysql>
 
  ENGINE = MYISAM;</mysql>
<section end=sql />
 

Latest revision as of 20:55, 25 January 2016

About

  • Purpose: Stores data for images relevant to displaying catalog entities (currently only Titles)

History

  • 2010-11-15
    • Added ID_Folder to allow use of different base URLs via cat_folders.
    • Removed WebSpec because nothing was using it and some of the data was missing and all of it used DOS-style paths.
      • Description of WebSpec field was: should be considered the official location for the purposes of page display; only image admin functions should update it.
  • 2010-11-16 Added WhenAdded and WhenEdited fields because... well, it's easy to do, and provides a secondary check against the event log.
  • 2016-01-25 Added CatKey field as part of getting rid of cat_pages.
    • Also finally removed WebSpec OLD from the actual data (was probably just a rename of WebSpec in 2010 in case removing it turned out to be a bad idea).

Fields

  • CatKey is much like CatKey in every other type of record, i.e. it defines part of the URL -- in this case, the part after the Title. The value should be the same as updating all records with the following SQL: <mysql>CatKey=CONCAT_WS("-",Ab_Size,AttrFldr)</mysql>
  • Spec (filesystem spec) can either be the official location of the file or can be updated from FileFerret using the IDFF data. It should eventually be renamed to something like FilePath, LocalSpec, StorSpec, SrcSpec...
  • FileFerret columns:
    • IDFF_File should always be set; this way, the file can be located if it gets moved. NOT NULL isn't required, though, because it may be necessary to find the file first and later request a FileFerret ID for it.
    • IDFF_Fideal is set opportunistically, for now. Later on we may want to have a policy that all VbzCart images should have a Fideal, but this will be determined as FileFerret is worked out.

Future

Spec should probably be renamed to something more specific like FilePath.

I had boldly planned to use FileFerret to manage image files, and towards that end had boldly removed any actual filespec information from this table, but then later realized that this was placing too much tight dependency on another entire subsystem. Maybe FileFerret should be responsible for keeping track of apps that use it, and for notifying them if any of their files are moved.

SQL

<mysql> CREATE TABLE `cat_images` (

 ID                  INT NOT NULL AUTO_INCREMENT,
 isActive           BOOL NOT NULL DEFAULT FALSE,
 CatKey     VARCHAR(63) DEFAULT NULL COMMENT "change to NOT NULL after populating",
 ID_Folder           INT NOT NULL COMMENT "base folder to which the Spec is relative",
 Spec      VARCHAR(255)  NOT NULL COMMENT "relative filespec for accessing image file",
 ID_Title            INT NOT NULL COMMENT "titles.ID of title to which this image applies",
 Ab_Size   VARCHAR(7)             COMMENT "ImgSizes.Ab: abbreviation for image size class",
 AttrFldr  VARCHAR(15)            COMMENT "folder (key) name for images with this attribute",
 AttrDispl VARCHAR(64)            COMMENT "description to display (e.g. in image tooltip) for this attribute",
 AttrSort  VARCHAR(15)            COMMENT "sorting order for this attribute",
 WhenAdded  DATETIME DEFAULT NULL COMMENT "when this record was created",
 WhenEdited DATETIME DEFAULT NULL COMMENT "when this record was last updated",
 IDFF_File       INT DEFAULT NULL COMMENT "FileFerret.Files.ID",
 IDFF_Fideal     INT DEFAULT NULL COMMENT "FileFerret.Fideals.ID",
 PRIMARY KEY(`ID`)
)
ENGINE = MYISAM;</mysql>