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

From Woozle Writes Code
Jump to navigation Jump to search
(original version, before modifications)
 
(minor updates, format tidying)
Line 3: Line 3:
==SQL==
==SQL==
<mysql>CREATE TABLE `files` (
<mysql>CREATE TABLE `files` (
   `ID`          INT NOT NULL AUTO_INCREMENT,
   `ID`          INT         NOT NULL AUTO_INCREMENT,
   `ID_Folder`  INT NOT NULL     COMMENT "Folders.ID of parent folder",
   `ID_Folder`  INT         NOT NULL COMMENT "Folders.ID of parent folder",
   `ID_Fideal`   INT DEFAULT NULL COMMENT "Fideals.ID for this file",
   `ID_Firev`   INT DEFAULT     NULL COMMENT "Firevs.ID for this file",
   `FileName`    VARCHAR(255)     COMMENT "just the filename.ext, not the full path",
   `FileName`    VARCHAR(255)         COMMENT "just the filename.ext, not the full path",
  `FileSize`    INT DEFAULT NULL COMMENT "number of bytes in file",
  `FileCksum`  INT DEFAULT NULL COMMENT "file's checksum (algorithm to be worked out later)",
   `WhenCreated` DATETIME DEFAULT NULL COMMENT "file's creation timestamp",
   `WhenCreated` DATETIME DEFAULT NULL COMMENT "file's creation timestamp",
   `WhenChanged` DATETIME DEFAULT NULL COMMENT "file's modification timestamp",
   `WhenChanged` DATETIME DEFAULT NULL COMMENT "file's modification timestamp",
   `FirstFound`  DATETIME NOT NULL     COMMENT "time/date when file was first found during a scan",
   `FirstFound`  DATETIME     NOT NULL COMMENT "time/date when file was first found during a scan",
   `LastFound`  DATETIME NOT NULL     COMMENT "time/date when file was most recently found during a scan",
   `LastFound`  DATETIME     NOT NULL COMMENT "time/date when file was most recently found during a scan",
   `isFound`    BOOL DEFAULT FALSE    COMMENT "TRUE = was found on most recent scan",
   `isFound`    BOOL DEFAULT FALSE    COMMENT "TRUE = was found on most recent scan",
   PRIMARY KEY(`ID`)
   PRIMARY KEY(`ID`)
)
)
ENGINE = MYISAM;</mysql>
ENGINE = MYISAM;</mysql>

Revision as of 18:51, 25 December 2012

About

  • Purpose: Tracks actual locations of files, and stats which may be different from file to file without affecting the data/content.

SQL

<mysql>CREATE TABLE `files` (

 `ID`          INT          NOT NULL AUTO_INCREMENT,
 `ID_Folder`   INT          NOT NULL COMMENT "Folders.ID of parent folder",
 `ID_Firev`    INT DEFAULT      NULL COMMENT "Firevs.ID for this file",
 `FileName`    VARCHAR(255)          COMMENT "just the filename.ext, not the full path",
 `WhenCreated` DATETIME DEFAULT NULL COMMENT "file's creation timestamp",
 `WhenChanged` DATETIME DEFAULT NULL COMMENT "file's modification timestamp",
 `FirstFound`  DATETIME     NOT NULL COMMENT "time/date when file was first found during a scan",
 `LastFound`   DATETIME     NOT NULL COMMENT "time/date when file was most recently found during a scan",
 `isFound`     BOOL DEFAULT FALSE    COMMENT "TRUE = was found on most recent scan",
 PRIMARY KEY(`ID`)

) ENGINE = MYISAM;</mysql>