Location: PHPKode > projects > PWhere > pwhere-0.4/doc/database.txt
TABLE categories
  num int(11) NOT NULL auto_increment   --- category identifier
  name varchar(150) NOT NULL,           --- category name
  description varchar(250) NOT NULL,    --- category description

PRIMARY KEY=num

In this table the program stores the information about the categories.



TABLE disks
  iddisk int(10) unsigned NOT NULL auto_increment  --- disk identifier
  name varchar(250) NOT NULL                       --- disk name
  num int(11) NOT NULL                             --- number in archive
  fsname varchar(250) NOT NULL                     --- device file
  path varchar(250) NOT NULL                       --- mounted path
  fstype varchar(50) NOT NULL                      --- filesystem type
  volume varchar(50) NOT NULL                      --- volume label
  full bigint(20) NOT NULL                         --- used space in bytes
  free bigint(20) NOT NULL                         --- free space in bytes
  date datetime NOT NULL                           --- disk insertion date
  serial varchar(100) NOT NULL                     --- serial number
  category int(11) NOT NULL                        --- category
  description varchar(250) NOT NULL                --- disk description
  
PRIMARY KEY=iddisk
UNIQUE KEY=(name,category)

Here the disks are stored and matched against categories. A disk can be stored
in more than one category thank to the unique key.


TABLE files
  idfile int(10) unsigned NOT NULL auto_increment  --- file identifier
  name varchar(250) NOT NULL                       --- file name
  disk varchar(250) NOT NULL                       --- disk name
  location varchar(250) NOT NULL                   --- file path
  rights char(10) NOT NULL                         --- rights
  owner varchar(50) NOT NULL                       --- file owner
  group varchar(50) NOT NULL                       --- file group
  inode int(11) NOT NULL                           --- inode number
  size bigint(20) NOT NULL                         --- file size in bytes
  creation_date datetime NOT NULL                  --- creation time
  access_date datetime NOT NULL                    --- access time
  modification_date datetime NOT NULL              --- modification time
  category int(11) NOT NULL                        --- category
  description varchar(250) NOT NULL                --- file description

PRIMARY KEY=idfile

Files and directories are saved in this table.


Table relationships
-------------------

                              CATEGORIES
/-\----------------------(0,n)--- num -----(0,n)-----------------/-\
R 1                                                              R 2
\-/                                                              \-/
|                                                                  |
|       DISK                                        FILES          |
|(1,1)- category ----------------/-\--------------- category -(1,1)|
                         (1,n)   R 3  (1,1)
        name --------------------\-/--------------- disk    
    
Return current item: PWhere