Add file monitoring table for cached inspections

This commit is contained in:
Dennis Eichhorn 2018-04-18 22:12:07 +02:00
parent 60143b8835
commit d35ab978aa

View File

@ -35,5 +35,26 @@ class Installer extends InstallerAbstract
public static function install(string $path, DatabasePool $dbPool, InfoManager $info) : void
{
parent::install(__DIR__ . '/..', $dbPool, $info);
switch ($dbPool->get()->getType()) {
case DatabaseType::MYSQL:
$dbPool->get()->con->beginTransaction();
$dbPool->get()->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'monitoring_file` (
`monitoring_file_id` int(11) NOT NULL AUTO_INCREMENT,
`monitoring_file_path` text DEFAULT NULL,
`monitoring_file_modified` datetime NOT NULL,
`monitoring_file_deprecated` tinyint(1) NOT NULL,
`monitoring_file_dangerous` tinyint(1) NOT NULL,
`monitoring_file_version` tinyint(1) NOT NULL,
`monitoring_file_hash` tinyint(1) NOT NULL,
`monitoring_file_status` tinyint(1) NOT NULL,
`monitoring_file_inspected` datetime NOT NULL,
PRIMARY KEY (`monitoring_file_id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
)->execute();
break;
}
}
}