+ INDEX (JobId, PathId, FilenameId)
+ );
+
+#
+# Possibly add one or more of the following indexes
+# to the above File table if your Verifies are
+# too slow.
+#
+# INDEX (PathId),
+# INDEX (FilenameId),
+# INDEX (FilenameId, PathId)
+# INDEX (JobId),
+#
+
+CREATE TABLE MediaType (
+ MediaTypeId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+ MediaType TINYBLOB NOT NULL,
+ ReadOnly TINYINT DEFAULT 0,
+ PRIMARY KEY(MediaTypeId)
+ );
+
+CREATE TABLE Storage (
+ StorageId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+ Name TINYBLOB NOT NULL,
+ AutoChanger TINYINT DEFAULT 0,
+ PRIMARY KEY(StorageId)
+ );
+
+CREATE TABLE Device (
+ DeviceId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+ Name TINYBLOB NOT NULL,
+ MediaTypeId INTEGER UNSIGNED DEFAULT 0 REFERENCES MediaType,
+ StorageId INTEGER UNSIGNED DEFAULT 0 REFERENCES Storage,
+ DevMounts INTEGER UNSIGNED DEFAULT 0,
+ DevReadBytes BIGINT UNSIGNED DEFAULT 0,
+ DevWriteBytes BIGINT UNSIGNED DEFAULT 0,
+ DevReadBytesSinceCleaning BIGINT UNSIGNED DEFAULT 0,
+ DevWriteBytesSinceCleaning BIGINT UNSIGNED DEFAULT 0,
+ DevReadTime BIGINT UNSIGNED DEFAULT 0,
+ DevWriteTime BIGINT UNSIGNED DEFAULT 0,
+ DevReadTimeSinceCleaning BIGINT UNSIGNED DEFAULT 0,
+ DevWriteTimeSinceCleaning BIGINT UNSIGNED DEFAULT 0,
+ CleaningDate DATETIME DEFAULT 0,
+ CleaningPeriod BIGINT UNSIGNED DEFAULT 0,
+ PRIMARY KEY(DeviceId)