Ferret File System/v0.1/SQL/folder: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(ID_Volume)
No edit summary
Line 1: Line 1:
==About==
==About==
===fields===
===fields===
* '''ID_Volume''' is the [[../vols|volume]] on which the folder appears.
* '''noScan''' is for blacklisting folders whose contents we really don't want to track, such as temp and trash areas which may become full of frequently-changing but useless clutter, or areas where things that aren't really files are kept (e.g. "/dev"), areas where drives are mounted ("/media", "/mnt"), etc.
** NULL if volume is unknown -- e.g. we might not know what volume a remote [[Samba]] share is on
* '''Name''' is not the full path, just the folder's filename. If it is the root folder of a volume (ID_Parent IS NULL), then Name should ''not'' be included as part of the path; drive letters and such are set in Mappings. Name must always be non-null, so this value is filled with something meaningless like "." if it is a root folder. (Maybe we'll put the volume name in there later.)
* '''noScan''' is for blacklisting folders whose contents we really don't want to track, such as temp and trash areas which may become full of frequently-changing but useless clutter, or areas where things that aren't really files are kept (e.g. "/dev")
* '''FirstFound''' and '''LastFound''' may need to be NULL for root folders. It's not clear why this happens (perhaps they were manually created -- but the code should have time-stamped them -- but possibly this was just an oversight, and wouldn't happen with production code).
===history===
===history===
* '''2013-06-30''' Added '''ID_Volume''' field as part of general schema redesign.
* '''2013-06-30''' Added '''ID_Volume''' field as part of general schema redesign.
* '''2016-02-27''' Removed '''isRecur''' and '''Descr''', added '''ID_Link'''. Moved many fields to {{l/same|dirent}} and replaced them with '''ID_Entry'''.
==SQL==
==SQL==
<mysql>CREATE TABLE `folders` (
<mysql>CREATE TABLE `folders` (
   `ID`         INT NOT NULL AUTO_INCREMENT,
   `ID_Entry`   INT NOT NULL,
  `ID_Parent`  INT DEFAULT NULL      COMMENT "parent folder; NULL = filesystem root",
  `ID_Volume`  INT DEFAULT NULL      COMMENT "volume on which this folder appears; NULL = unknown",
  `Name`        VARCHAR(255) NOT NULL COMMENT "filesystem's name for the folder",
  `Descr`      VARCHAR(255) DEFAULT NULL COMMENT "description for human consumption (optional; mainly for local roots)",
  `WhenCreated` DATETIME DEFAULT NULL COMMENT "folder's creation timestamp, where available",
  `WhenChanged` DATETIME DEFAULT NULL COMMENT "folder's modification timestamp, where available",
  `FirstFound`  DATETIME DEFAULT NULL COMMENT "time/date when folder was first found during a scan",
  `LastFound`  DATETIME DEFAULT NULL COMMENT "time/date when folder was most recently found during a scan",
  `isFound`    BOOL DEFAULT FALSE    COMMENT "TRUE = was found on most recent scan",
   `noScan`      BOOL DEFAULT FALSE    COMMENT "TRUE = for whatever reason, don't bother scanning inside this folder",
   `noScan`      BOOL DEFAULT FALSE    COMMENT "TRUE = for whatever reason, don't bother scanning inside this folder",
   `wasDenied`  BOOL DEFAULT FALSE    COMMENT "TRUE = filesystem did not allow access on last scan attempt",
   UNIQUE KEY(`ID_Entry`)
  `isRecur`    BOOL DEFAULT FALSE    COMMENT "TRUE = this folder is a repeat of a parent folder, probably due to a recursive link",
  PRIMARY KEY(`ID`)
)
)
ENGINE = MYISAM;</mysql>
ENGINE = INNODB;</mysql>

Revision as of 17:17, 27 February 2016

About

fields

  • noScan is for blacklisting folders whose contents we really don't want to track, such as temp and trash areas which may become full of frequently-changing but useless clutter, or areas where things that aren't really files are kept (e.g. "/dev"), areas where drives are mounted ("/media", "/mnt"), etc.

history

  • 2013-06-30 Added ID_Volume field as part of general schema redesign.
  • 2016-02-27 Removed isRecur and Descr, added ID_Link. Moved many fields to dirent and replaced them with ID_Entry.

SQL

<mysql>CREATE TABLE `folders` (

 `ID_Entry`    INT NOT NULL,
 `noScan`      BOOL DEFAULT FALSE    COMMENT "TRUE = for whatever reason, don't bother scanning inside this folder",
 UNIQUE KEY(`ID_Entry`)

) ENGINE = INNODB;</mysql>