Ferret File System/v0.1/SQL/entry: Difference between revisions
< Ferret File System | v0.1 | SQL
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
* '''ID_Volume''' is the [[../vols|volume]] on which the directory entry appears. | * '''ID_Volume''' is the [[../vols|volume]] on which the directory entry appears. | ||
** NULL if volume is unknown -- e.g. we might not know what volume a remote [[Samba]] share is on. Not sure if this will be used. | ** NULL if volume is unknown -- e.g. we might not know what volume a remote [[Samba]] share is on. Not sure if this will be used. | ||
* '''Name''' is not the full path, just the entry's filename ( | * '''Name''' is not the full path, just the entry's filename (including any .ext). If it is the root folder of a volume (ID_Parent IS NULL), then Name should ''not'' be included when constructing a path or filespec. Name must always be non-null, so this value is filled with something meaningless like "" if it is a root folder. | ||
===history=== | ===history=== | ||
* '''2016-02-27''' started | * '''2016-02-27''' started | ||
* '''2017-12-03''' Inode, didSeek | |||
==SQL== | ==SQL== | ||
<mysql>CREATE TABLE `entry` ( | <syntaxhighlight lang=mysql>CREATE TABLE `entry` ( | ||
`ID` INT NOT NULL AUTO_INCREMENT, | `ID` INT NOT NULL AUTO_INCREMENT, | ||
`ID_Volume` INT DEFAULT NULL COMMENT "volume on which this entry appears; NULL = unknown", | `ID_Volume` INT DEFAULT NULL COMMENT "volume on which this entry appears; NULL = unknown", | ||
`ID_Parent` INT DEFAULT NULL COMMENT "parent folder; NULL = filesystem root", | `ID_Parent` INT DEFAULT NULL COMMENT "parent folder; NULL = filesystem root", | ||
`ID_Link` INT DEFAULT NULL COMMENT "NOT NULL = this is a link to another entry whose ID is ID_Link", | `ID_Link` INT DEFAULT NULL COMMENT "NOT NULL = this is a link to another entry whose ID is ID_Link", | ||
`Inode` INT DEFAULT NULL COMMENT "inode number (if available)", | |||
`Name` VARCHAR(255) NOT NULL COMMENT "filesystem's name for the entry", | `Name` VARCHAR(255) NOT NULL COMMENT "filesystem's name for the entry", | ||
`WhenCreated` DATETIME DEFAULT NULL COMMENT "entry's creation timestamp, where available", | `WhenCreated` DATETIME DEFAULT NULL COMMENT "entry's creation timestamp, where available", | ||
`WhenChanged` DATETIME DEFAULT NULL COMMENT "entry's modification timestamp, where available", | `WhenChanged` DATETIME DEFAULT NULL COMMENT "entry's modification timestamp, where available", | ||
`didSeek` BOOL DEFAULT FALSE COMMENT "TRUE = looked for this entry in the filesystem", | |||
`didFind` BOOL DEFAULT FALSE COMMENT "TRUE = was found on most recent scan", | `didFind` BOOL DEFAULT FALSE COMMENT "TRUE = was found on most recent scan", | ||
`didRead` BOOL DEFAULT FALSE COMMENT "TRUE = filesystem allowed read access on last scan attempt", | `didRead` BOOL DEFAULT FALSE COMMENT "TRUE = filesystem allowed read access on last scan attempt", | ||
PRIMARY KEY(`ID`) | PRIMARY KEY(`ID`) | ||
) | ) | ||
ENGINE = INNODB;</ | ENGINE = INNODB;</syntaxhighlight> |
Revision as of 00:27, 4 December 2017
About
- Purpose: base table for files, folders, and possibly other types of directory entries
fields
- ID_Volume is the volume on which the directory entry appears.
- NULL if volume is unknown -- e.g. we might not know what volume a remote Samba share is on. Not sure if this will be used.
- Name is not the full path, just the entry's filename (including any .ext). If it is the root folder of a volume (ID_Parent IS NULL), then Name should not be included when constructing a path or filespec. Name must always be non-null, so this value is filled with something meaningless like "" if it is a root folder.
history
- 2016-02-27 started
- 2017-12-03 Inode, didSeek
SQL
CREATE TABLE `entry` (
`ID` INT NOT NULL AUTO_INCREMENT,
`ID_Volume` INT DEFAULT NULL COMMENT "volume on which this entry appears; NULL = unknown",
`ID_Parent` INT DEFAULT NULL COMMENT "parent folder; NULL = filesystem root",
`ID_Link` INT DEFAULT NULL COMMENT "NOT NULL = this is a link to another entry whose ID is ID_Link",
`Inode` INT DEFAULT NULL COMMENT "inode number (if available)",
`Name` VARCHAR(255) NOT NULL COMMENT "filesystem's name for the entry",
`WhenCreated` DATETIME DEFAULT NULL COMMENT "entry's creation timestamp, where available",
`WhenChanged` DATETIME DEFAULT NULL COMMENT "entry's modification timestamp, where available",
`didSeek` BOOL DEFAULT FALSE COMMENT "TRUE = looked for this entry in the filesystem",
`didFind` BOOL DEFAULT FALSE COMMENT "TRUE = was found on most recent scan",
`didRead` BOOL DEFAULT FALSE COMMENT "TRUE = filesystem allowed read access on last scan attempt",
PRIMARY KEY(`ID`)
)
ENGINE = INNODB;