mirror of
https://github.com/Karaka-Management/oms-Monitoring.git
synced 2026-01-11 16:38:40 +00:00
Move schema to json
This commit is contained in:
parent
6381562b95
commit
d4eedecb53
60
Admin/Install/db.json
Normal file
60
Admin/Install/db.json
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
"monitoring_file": {
|
||||
"name": "monitoring_file",
|
||||
"fields": {
|
||||
"monitoring_file_id": {
|
||||
"name": "monitoring_file_id",
|
||||
"type": "INT",
|
||||
"null": false,
|
||||
"primary": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"monitoring_file_path": {
|
||||
"name": "monitoring_file_path",
|
||||
"type": "VARCHAR(255)",
|
||||
"default": null,
|
||||
"null": true
|
||||
},
|
||||
"monitoring_file_modified": {
|
||||
"name": "monitoring_file_modified",
|
||||
"type": "DATETIME",
|
||||
"null": false
|
||||
},
|
||||
"monitoring_file_deprecated": {
|
||||
"name": "monitoring_file_deprecated",
|
||||
"type": "TINYINT",
|
||||
"null": false
|
||||
},
|
||||
"monitoring_file_dangerous": {
|
||||
"name": "monitoring_file_dangerous",
|
||||
"type": "TINYINT",
|
||||
"null": false
|
||||
},
|
||||
"monitoring_file_unicode": {
|
||||
"name": "monitoring_file_unicode",
|
||||
"type": "TINYINT",
|
||||
"null": false
|
||||
},
|
||||
"monitoring_file_version": {
|
||||
"name": "monitoring_file_version",
|
||||
"type": "TINYINT",
|
||||
"null": false
|
||||
},
|
||||
"monitoring_file_hash": {
|
||||
"name": "monitoring_file_hash",
|
||||
"type": "TINYINT",
|
||||
"null": false
|
||||
},
|
||||
"monitoring_file_status": {
|
||||
"name": "monitoring_file_status",
|
||||
"type": "TINYINT",
|
||||
"null": false
|
||||
},
|
||||
"monitoring_file_inspected": {
|
||||
"name": "monitoring_file_inspected",
|
||||
"type": "DATETIME",
|
||||
"null": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -14,9 +14,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Monitoring\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
use phpOMS\DataStorage\Database\DatabaseType;
|
||||
use phpOMS\Module\InfoManager;
|
||||
use phpOMS\Module\InstallerAbstract;
|
||||
|
||||
/**
|
||||
|
|
@ -29,36 +26,4 @@ use phpOMS\Module\InstallerAbstract;
|
|||
*/
|
||||
class Installer extends InstallerAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function install(DatabasePool $dbPool, InfoManager $info) : void
|
||||
{
|
||||
parent::install($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_unicode` 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();
|
||||
|
||||
$dbPool->get()->con->commit();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user