Ferret File System/design

From Woozle Writes Code
< Ferret File System
Revision as of 21:56, 7 July 2024 by Woozle (talk | contribs) (Created page with "{{fmt/title|FFS: let's just make some tables and see what we can get working}} ==Tables== ===Content=== <syntaxhighlight lang=sql> CREATE TABLE `content` ( `ID` int(10) unsigned NOT NULL AUTO_INCREMENT, `WhenFirst` timestamp NOT NULL DEFAULT current_timestamp(), `WhenFinal` timestamp NOT NULL, `HashType` varchar(255) NOT NULL, `HashData` varchar(255) NOT NULL, `Bytes` bigint(20) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE = InnoDB <...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
FFS: let's just make some tables and see what we can get working

Tables

Content

CREATE TABLE
  `content` (
    `ID`        int(10) unsigned NOT NULL AUTO_INCREMENT,
    `WhenFirst` timestamp NOT NULL DEFAULT current_timestamp(),
    `WhenFinal` timestamp NOT NULL,
    `HashType`  varchar(255) NOT NULL,
    `HashData`  varchar(255) NOT NULL,
    `Bytes`     bigint(20) NOT NULL,
    PRIMARY KEY (`ID`)
  ) ENGINE = InnoDB

Filesystem Entries

CREATE TABLE
  `fs_entry` (
    `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `ID_Parent` int(11) DEFAULT NULL,
    `FirstSeen` timestamp NOT NULL DEFAULT current_timestamp(),
    `FirstGone` timestamp NULL DEFAULT NULL COMMENT 'NULL if found on last pass',
    `Name` varchar(255) NOT NULL,
    PRIMARY KEY (`ID`)
  ) ENGINE = InnoDB

Spidering

CREATE TABLE
  `spider` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `WhenStart`  timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'when the crawl started',
    `WhenDone`   timestamp NULL DEFAULT NULL COMMENT 'when it finished',
    `ID_Entry`   int(11) NOT NULL COMMENT 'top of tree being crawled',
    PRIMARY KEY (`id`)
  ) ENGINE = InnoDB

Spidering Entry

CREATE TABLE
  `spider_entry` (
    `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `WhenOpen`   timestamp NOT NULL DEFAULT current_timestamp(),
    `WhenShut`   timestamp NULL DEFAULT NULL,
    `ID_Spider`  int(11) NOT NULL,
    `ID_Entry`   int(11) NOT NULL,
    `ID_Hash`    int(11) NOT NULL,
    `isFound`    tinyint(1) NOT NULL,
    PRIMARY KEY (`ID`)
  ) ENGINE = InnoDB