fix: [MYSQL.sql] added first/last seen

pull/6585/head
iglocska 2020-11-14 15:14:19 +01:00
parent c0419cc8b5
commit ffc45f1b3d
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 14 additions and 2 deletions

View File

@ -52,6 +52,8 @@ CREATE TABLE IF NOT EXISTS `attributes` (
`comment` text COLLATE utf8_bin,
`deleted` tinyint(1) NOT NULL DEFAULT 0,
`disable_correlation` tinyint(1) NOT NULL DEFAULT 0,
`first_seen` BIGINT(20) NULL DEFAULT NULL,
`last_seen` BIGINT(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `event_id` (`event_id`),
INDEX `object_id` (`object_id`),
@ -61,6 +63,8 @@ CREATE TABLE IF NOT EXISTS `attributes` (
INDEX `type` (`type`),
INDEX `category` (`category`),
INDEX `sharing_group_id` (`sharing_group_id`),
INDEX `first_seen` (`first_seen`),
INDEX `last_seen` (`last_seen`),
UNIQUE INDEX `uuid` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
@ -664,6 +668,8 @@ CREATE TABLE IF NOT EXISTS `objects` (
`sharing_group_id` int(11),
`comment` text COLLATE utf8_bin NOT NULL,
`deleted` tinyint(1) NOT NULL DEFAULT 0,
`first_seen` BIGINT(20) NULL DEFAULT NULL,
`last_seen` BIGINT(20) NULL DEFAULT NULL,
PRIMARY KEY (id),
INDEX `name` (`name`),
INDEX `template_uuid` (`template_uuid`),
@ -673,7 +679,9 @@ CREATE TABLE IF NOT EXISTS `objects` (
INDEX `uuid` (`uuid`),
INDEX `timestamp` (`timestamp`),
INDEX `distribution` (`distribution`),
INDEX `sharing_group_id` (`sharing_group_id`)
INDEX `sharing_group_id` (`sharing_group_id`),
INDEX `first_seen` (`first_seen`),
INDEX `last_seen` (`last_seen`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
@ -961,6 +969,8 @@ CREATE TABLE IF NOT EXISTS `shadow_attributes` (
`timestamp` int(11) NOT NULL DEFAULT 0,
`proposal_to_delete` BOOLEAN NOT NULL DEFAULT 0,
`disable_correlation` tinyint(1) NOT NULL DEFAULT 0,
`first_seen` BIGINT(20) NULL DEFAULT NULL,
`last_seen` BIGINT(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `event_id` (`event_id`),
INDEX `event_uuid` (`event_uuid`),
@ -970,7 +980,9 @@ CREATE TABLE IF NOT EXISTS `shadow_attributes` (
INDEX `value1` (`value1`(255)),
INDEX `value2` (`value2`(255)),
INDEX `type` (`type`),
INDEX `category` (`category`)
INDEX `category` (`category`),
INDEX `first_seen` (`first_seen`),
INDEX `last_seen` (`last_seen`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------