Private
Public Access
1
0

Upgrade Go & dependencies
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-01-17 21:03:31 -08:00
parent e316aeee99
commit a5b1f9ef08
11 changed files with 225 additions and 166 deletions

View File

@@ -1,8 +1,9 @@
-- MariaDB dump 10.19 Distrib 10.11.6-MariaDB, for Linux (x86_64)
/*M!999999\- enable the sandbox mode */
-- MariaDB dump 10.19-11.4.4-MariaDB, for Linux (x86_64)
--
-- Host: ntp-db-mysql-master.ntpdb.svc.cluster.local Database: askntp
-- Host: ntpdb-haproxy.ntpdb.svc.cluster.local Database: askntp
-- ------------------------------------------------------
-- Server version 5.7.35-38-log
-- Server version 8.0.40-31
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -13,7 +14,7 @@
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
--
-- Table structure for table `account_invites`
@@ -23,12 +24,12 @@ DROP TABLE IF EXISTS `account_invites`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `account_invites` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`account_id` int unsigned NOT NULL,
`email` varchar(255) NOT NULL,
`status` enum('pending','accepted','expired') DEFAULT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
`sent_by_id` int(10) unsigned NOT NULL,
`user_id` int unsigned DEFAULT NULL,
`sent_by_id` int unsigned NOT NULL,
`code` varchar(25) NOT NULL,
`expires_on` datetime NOT NULL,
`created_on` datetime NOT NULL,
@@ -41,7 +42,7 @@ CREATE TABLE `account_invites` (
CONSTRAINT `account_invites_account_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
CONSTRAINT `account_invites_sent_by_fk` FOREIGN KEY (`sent_by_id`) REFERENCES `users` (`id`),
CONSTRAINT `account_invites_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -52,13 +53,13 @@ DROP TABLE IF EXISTS `account_subscriptions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `account_subscriptions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`stripe_subscription_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`account_id` int unsigned NOT NULL,
`stripe_subscription_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
`status` enum('incomplete','incomplete_expired','trialing','active','past_due','canceled','unpaid','ended') DEFAULT NULL,
`name` varchar(255) NOT NULL,
`max_zones` int(10) unsigned NOT NULL,
`max_devices` int(10) unsigned NOT NULL,
`max_zones` int unsigned NOT NULL,
`max_devices` int unsigned NOT NULL,
`created_on` datetime NOT NULL,
`ended_on` datetime DEFAULT NULL,
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
@@ -66,7 +67,7 @@ CREATE TABLE `account_subscriptions` (
UNIQUE KEY `stripe_subscription_id` (`stripe_subscription_id`),
KEY `account_subscriptions_account_fk` (`account_id`),
CONSTRAINT `account_subscriptions_account_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -77,13 +78,13 @@ DROP TABLE IF EXISTS `account_users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `account_users` (
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`account_id` int unsigned NOT NULL,
`user_id` int unsigned NOT NULL,
PRIMARY KEY (`account_id`,`user_id`),
KEY `account_users_user_fk` (`user_id`),
CONSTRAINT `account_users_account_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
CONSTRAINT `account_users_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -94,7 +95,7 @@ DROP TABLE IF EXISTS `accounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accounts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`organization_name` varchar(150) DEFAULT NULL,
`organization_url` varchar(150) DEFAULT NULL,
@@ -103,11 +104,11 @@ CREATE TABLE `accounts` (
`flags` varchar(4096) NOT NULL DEFAULT '{}',
`created_on` datetime NOT NULL,
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`stripe_customer_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`stripe_customer_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `url_slug_idx` (`url_slug`),
UNIQUE KEY `stripe_customer_id` (`stripe_customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -118,14 +119,20 @@ DROP TABLE IF EXISTS `api_keys`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `api_keys` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`account_id` int unsigned DEFAULT NULL,
`user_id` int unsigned DEFAULT NULL,
`api_key` varchar(255) DEFAULT NULL,
`grants` text,
`audience` text NOT NULL,
`token_lookup` varchar(16) NOT NULL,
`token_hashed` varchar(256) NOT NULL,
`last_seen` datetime DEFAULT NULL,
`created_on` datetime NOT NULL,
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `api_key` (`api_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -147,7 +154,7 @@ CREATE TABLE `combust_cache` (
PRIMARY KEY (`id`,`type`),
KEY `expire_idx` (`expire`),
KEY `purge_idx` (`purge_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -158,8 +165,8 @@ DROP TABLE IF EXISTS `combust_secrets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `combust_secrets` (
`secret_ts` int(10) unsigned NOT NULL,
`expires_ts` int(10) unsigned NOT NULL,
`secret_ts` int unsigned NOT NULL,
`expires_ts` int unsigned NOT NULL,
`type` varchar(32) NOT NULL,
`secret` char(32) DEFAULT NULL,
PRIMARY KEY (`type`,`secret_ts`),
@@ -175,14 +182,14 @@ DROP TABLE IF EXISTS `dns_roots`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `dns_roots` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`origin` varchar(255) NOT NULL,
`vendor_available` tinyint(4) NOT NULL DEFAULT '0',
`general_use` tinyint(4) NOT NULL DEFAULT '0',
`vendor_available` tinyint NOT NULL DEFAULT '0',
`general_use` tinyint NOT NULL DEFAULT '0',
`ns_list` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `origin` (`origin`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -193,14 +200,14 @@ DROP TABLE IF EXISTS `log_scores`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log_scores` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`monitor_id` int(10) unsigned DEFAULT NULL,
`server_id` int(10) unsigned NOT NULL,
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`monitor_id` int unsigned DEFAULT NULL,
`server_id` int unsigned NOT NULL,
`ts` datetime NOT NULL,
`score` double NOT NULL DEFAULT '0',
`step` double NOT NULL DEFAULT '0',
`offset` double DEFAULT NULL,
`rtt` mediumint(9) DEFAULT NULL,
`rtt` mediumint DEFAULT NULL,
`attributes` text,
PRIMARY KEY (`id`),
KEY `log_scores_server_ts_idx` (`server_id`,`ts`),
@@ -208,7 +215,7 @@ CREATE TABLE `log_scores` (
KEY `log_score_monitor_id_fk` (`monitor_id`),
CONSTRAINT `log_score_monitor_id_fk` FOREIGN KEY (`monitor_id`) REFERENCES `monitors` (`id`),
CONSTRAINT `log_scores_server` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -219,15 +226,15 @@ DROP TABLE IF EXISTS `log_scores_archive_status`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log_scores_archive_status` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`archiver` varchar(255) NOT NULL,
`log_score_id` bigint(20) unsigned DEFAULT NULL,
`log_score_id` bigint unsigned DEFAULT NULL,
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `archiver` (`archiver`),
KEY `log_score_id` (`log_score_id`),
CONSTRAINT `log_score_id` FOREIGN KEY (`log_score_id`) REFERENCES `log_scores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -238,11 +245,11 @@ DROP TABLE IF EXISTS `logs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `logs` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned DEFAULT NULL,
`server_id` int(10) unsigned DEFAULT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
`vendor_zone_id` int(10) unsigned DEFAULT NULL,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`account_id` int unsigned DEFAULT NULL,
`server_id` int unsigned DEFAULT NULL,
`user_id` int unsigned DEFAULT NULL,
`vendor_zone_id` int unsigned DEFAULT NULL,
`type` varchar(50) DEFAULT NULL,
`message` text,
`changes` text,
@@ -256,7 +263,38 @@ CREATE TABLE `logs` (
CONSTRAINT `logs_vendor_zone_id` FOREIGN KEY (`vendor_zone_id`) REFERENCES `vendor_zones` (`id`) ON DELETE CASCADE,
CONSTRAINT `server_logs_server_id` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE,
CONSTRAINT `server_logs_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `monitor_registrations`
--
DROP TABLE IF EXISTS `monitor_registrations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `monitor_registrations` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`monitor_id` int unsigned DEFAULT NULL,
`request_token` varchar(128) NOT NULL,
`verification_token` varchar(32) NOT NULL,
`ip4` varchar(15) NOT NULL DEFAULT '',
`ip6` varchar(39) NOT NULL DEFAULT '',
`name` varchar(256) NOT NULL DEFAULT '',
`location_code` varchar(5) NOT NULL DEFAULT '',
`account_id` int unsigned DEFAULT NULL,
`client` varchar(256) NOT NULL DEFAULT '',
`status` enum('pending','accepted','completed','rejected','cancelled') NOT NULL,
`last_seen` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_on` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `request_token` (`request_token`),
UNIQUE KEY `verification_token` (`verification_token`),
KEY `monitor_registrations_monitor_id_fk` (`monitor_id`),
KEY `monitor_registrations_account_fk` (`account_id`),
CONSTRAINT `monitor_registrations_account_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
CONSTRAINT `monitor_registrations_monitor_id_fk` FOREIGN KEY (`monitor_id`) REFERENCES `monitors` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -267,10 +305,10 @@ DROP TABLE IF EXISTS `monitors`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `monitors` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`type` enum('monitor','score') NOT NULL DEFAULT 'monitor',
`user_id` int(10) unsigned DEFAULT NULL,
`account_id` int(10) unsigned DEFAULT NULL,
`user_id` int unsigned DEFAULT NULL,
`account_id` int unsigned DEFAULT NULL,
`name` varchar(30) NOT NULL,
`location` varchar(255) NOT NULL DEFAULT '',
`ip` varchar(40) DEFAULT NULL,
@@ -286,13 +324,13 @@ CREATE TABLE `monitors` (
PRIMARY KEY (`id`),
UNIQUE KEY `ip` (`ip`,`ip_version`),
UNIQUE KEY `api_key` (`api_key`),
UNIQUE KEY `monitors_tls_name` (`tls_name`),
UNIQUE KEY `monitors_tls_name` (`tls_name`,`ip_version`),
KEY `monitors_user_id` (`user_id`),
KEY `monitors_account_fk` (`account_id`),
KEY `type_status` (`type`,`status`),
CONSTRAINT `monitors_account_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
CONSTRAINT `monitors_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -324,10 +362,10 @@ DROP TABLE IF EXISTS `schema_revision`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `schema_revision` (
`revision` smallint(5) unsigned NOT NULL DEFAULT '0',
`revision` smallint unsigned NOT NULL DEFAULT '0',
`schema_name` varchar(30) NOT NULL,
PRIMARY KEY (`schema_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -338,16 +376,16 @@ DROP TABLE IF EXISTS `scorer_status`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `scorer_status` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`scorer_id` int(10) unsigned NOT NULL,
`log_score_id` bigint(20) unsigned NOT NULL,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`scorer_id` int unsigned NOT NULL,
`log_score_id` bigint unsigned NOT NULL,
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `scorer_log_score_id` (`log_score_id`),
KEY `scores_status_monitor_id_fk` (`scorer_id`),
CONSTRAINT `scorer_log_score_id` FOREIGN KEY (`log_score_id`) REFERENCES `log_scores` (`id`),
CONSTRAINT `scores_status_monitor_id_fk` FOREIGN KEY (`scorer_id`) REFERENCES `monitors` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -358,13 +396,13 @@ DROP TABLE IF EXISTS `server_alerts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `server_alerts` (
`server_id` int(10) unsigned NOT NULL,
`server_id` int unsigned NOT NULL,
`last_score` double NOT NULL,
`first_email_time` datetime NOT NULL,
`last_email_time` datetime DEFAULT NULL,
PRIMARY KEY (`server_id`),
CONSTRAINT `server_alerts_server` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -375,8 +413,8 @@ DROP TABLE IF EXISTS `server_notes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `server_notes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`server_id` int(10) unsigned NOT NULL,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`server_id` int unsigned NOT NULL,
`name` varchar(255) NOT NULL DEFAULT '',
`note` text NOT NULL,
`created_on` datetime NOT NULL,
@@ -385,7 +423,7 @@ CREATE TABLE `server_notes` (
UNIQUE KEY `server` (`server_id`,`name`),
KEY `name` (`name`),
CONSTRAINT `server_notes_ibfk_1` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -396,12 +434,12 @@ DROP TABLE IF EXISTS `server_scores`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `server_scores` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`monitor_id` int(10) unsigned NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`monitor_id` int unsigned NOT NULL,
`server_id` int unsigned NOT NULL,
`score_ts` datetime DEFAULT NULL,
`score_raw` double NOT NULL DEFAULT '0',
`stratum` tinyint(3) unsigned DEFAULT NULL,
`stratum` tinyint unsigned DEFAULT NULL,
`status` enum('new','testing','active') NOT NULL DEFAULT 'new',
`queue_ts` datetime DEFAULT NULL,
`created_on` datetime NOT NULL,
@@ -412,7 +450,7 @@ CREATE TABLE `server_scores` (
KEY `monitor_id_2` (`monitor_id`,`score_ts`),
CONSTRAINT `server_score_monitor_fk` FOREIGN KEY (`monitor_id`) REFERENCES `monitors` (`id`),
CONSTRAINT `server_score_server_id` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -423,13 +461,13 @@ DROP TABLE IF EXISTS `server_urls`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `server_urls` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`server_id` int(10) unsigned NOT NULL,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`server_id` int unsigned NOT NULL,
`url` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `server` (`server_id`),
CONSTRAINT `server_urls_server` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -440,9 +478,9 @@ DROP TABLE IF EXISTS `server_verifications`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `server_verifications` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`server_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`server_id` int unsigned NOT NULL,
`user_id` int unsigned DEFAULT NULL,
`user_ip` varchar(45) NOT NULL DEFAULT '',
`indirect_ip` varchar(45) NOT NULL DEFAULT '',
`verified_on` datetime DEFAULT NULL,
@@ -455,7 +493,7 @@ CREATE TABLE `server_verifications` (
KEY `server_verifications_ibfk_2` (`user_id`),
CONSTRAINT `server_verifications_ibfk_1` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE,
CONSTRAINT `server_verifications_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -466,9 +504,9 @@ DROP TABLE IF EXISTS `server_verifications_history`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `server_verifications_history` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`server_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`server_id` int unsigned NOT NULL,
`user_id` int unsigned DEFAULT NULL,
`user_ip` varchar(45) NOT NULL DEFAULT '',
`indirect_ip` varchar(45) NOT NULL DEFAULT '',
`verified_on` datetime DEFAULT NULL,
@@ -479,7 +517,7 @@ CREATE TABLE `server_verifications_history` (
KEY `server_verifications_history_ibfk_2` (`user_id`),
CONSTRAINT `server_verifications_history_ibfk_1` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE,
CONSTRAINT `server_verifications_history_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -490,13 +528,13 @@ DROP TABLE IF EXISTS `server_zones`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `server_zones` (
`server_id` int(10) unsigned NOT NULL,
`zone_id` int(10) unsigned NOT NULL,
`server_id` int unsigned NOT NULL,
`zone_id` int unsigned NOT NULL,
PRIMARY KEY (`server_id`,`zone_id`),
KEY `locations_zone` (`zone_id`),
CONSTRAINT `locations_server` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE,
CONSTRAINT `locations_zone` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -507,17 +545,17 @@ DROP TABLE IF EXISTS `servers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `servers` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`ip` varchar(40) NOT NULL,
`ip_version` enum('v4','v6') NOT NULL DEFAULT 'v4',
`user_id` int(10) unsigned DEFAULT NULL,
`account_id` int(10) unsigned DEFAULT NULL,
`user_id` int unsigned DEFAULT NULL,
`account_id` int unsigned DEFAULT NULL,
`hostname` varchar(255) DEFAULT NULL,
`stratum` tinyint(3) unsigned DEFAULT NULL,
`in_pool` tinyint(3) unsigned NOT NULL DEFAULT '0',
`in_server_list` tinyint(3) unsigned NOT NULL DEFAULT '0',
`netspeed` int(10) unsigned NOT NULL DEFAULT '10000',
`netspeed_target` int(10) unsigned NOT NULL DEFAULT '10000',
`stratum` tinyint unsigned DEFAULT NULL,
`in_pool` tinyint unsigned NOT NULL DEFAULT '0',
`in_server_list` tinyint unsigned NOT NULL DEFAULT '0',
`netspeed` int unsigned NOT NULL DEFAULT '10000',
`netspeed_target` int unsigned NOT NULL DEFAULT '10000',
`created_on` datetime NOT NULL,
`updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`score_ts` datetime DEFAULT NULL,
@@ -532,7 +570,7 @@ CREATE TABLE `servers` (
KEY `server_account_fk` (`account_id`),
CONSTRAINT `server_account_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
CONSTRAINT `servers_user_ibfk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -543,7 +581,7 @@ DROP TABLE IF EXISTS `servers_monitor_review`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `servers_monitor_review` (
`server_id` int(10) unsigned NOT NULL,
`server_id` int unsigned NOT NULL,
`last_review` datetime DEFAULT NULL,
`next_review` datetime DEFAULT NULL,
`last_change` datetime DEFAULT NULL,
@@ -551,7 +589,7 @@ CREATE TABLE `servers_monitor_review` (
PRIMARY KEY (`server_id`),
KEY `next_review` (`next_review`),
CONSTRAINT `server_monitor_review_server_id_fk` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -562,14 +600,14 @@ DROP TABLE IF EXISTS `system_settings`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `system_settings` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`key` varchar(255) NOT NULL,
`value` text NOT NULL,
`created_on` datetime NOT NULL,
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `key` (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -580,15 +618,15 @@ DROP TABLE IF EXISTS `user_equipment_applications`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_equipment_applications` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`user_id` int unsigned NOT NULL,
`application` text,
`contact_information` text,
`status` enum('New','Pending','Maybe','No','Approved') NOT NULL DEFAULT 'New',
PRIMARY KEY (`id`),
KEY `user_equipment_applications_user_id` (`user_id`),
CONSTRAINT `user_equipment_applications_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -599,9 +637,9 @@ DROP TABLE IF EXISTS `user_identities`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_identities` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`profile_id` varchar(255) NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`user_id` int unsigned NOT NULL,
`provider` varchar(255) NOT NULL,
`data` text,
`email` varchar(255) DEFAULT NULL,
@@ -611,7 +649,7 @@ CREATE TABLE `user_identities` (
UNIQUE KEY `profile_id` (`profile_id`),
KEY `user_identities_user_id` (`user_id`),
CONSTRAINT `user_identities_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -622,14 +660,35 @@ DROP TABLE IF EXISTS `user_privileges`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_privileges` (
`user_id` int(10) unsigned NOT NULL,
`user_id` int unsigned NOT NULL,
`see_all_servers` tinyint(1) NOT NULL DEFAULT '0',
`vendor_admin` tinyint(4) NOT NULL DEFAULT '0',
`equipment_admin` tinyint(4) NOT NULL DEFAULT '0',
`support_staff` tinyint(4) NOT NULL DEFAULT '0',
`vendor_admin` tinyint NOT NULL DEFAULT '0',
`equipment_admin` tinyint NOT NULL DEFAULT '0',
`support_staff` tinyint NOT NULL DEFAULT '0',
PRIMARY KEY (`user_id`),
CONSTRAINT `user_privileges_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `user_sessions`
--
DROP TABLE IF EXISTS `user_sessions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_sessions` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`user_id` int unsigned NOT NULL,
`token_lookup` varchar(16) NOT NULL,
`token_hashed` varchar(256) NOT NULL,
`last_seen` datetime DEFAULT NULL,
`created_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `user_sessions_user_fk` (`user_id`),
KEY `token_lookup` (`token_lookup`),
CONSTRAINT `user_sessions_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -640,8 +699,8 @@ DROP TABLE IF EXISTS `user_tasks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_tasks` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned DEFAULT NULL,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`user_id` int unsigned DEFAULT NULL,
`task` enum('download','delete') NOT NULL,
`status` text NOT NULL,
`traceid` varchar(32) NOT NULL DEFAULT '',
@@ -651,7 +710,7 @@ CREATE TABLE `user_tasks` (
PRIMARY KEY (`id`),
KEY `user_tasks_user_fk` (`user_id`),
CONSTRAINT `user_tasks_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -662,7 +721,7 @@ DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`username` varchar(40) DEFAULT NULL,
@@ -671,7 +730,7 @@ CREATE TABLE `users` (
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -682,24 +741,24 @@ DROP TABLE IF EXISTS `vendor_zones`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vendor_zones` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`zone_name` varchar(90) NOT NULL,
`status` enum('New','Pending','Approved','Rejected') NOT NULL DEFAULT 'New',
`user_id` int(10) unsigned DEFAULT NULL,
`user_id` int unsigned DEFAULT NULL,
`organization_name` varchar(255) DEFAULT NULL,
`client_type` enum('ntp','sntp','legacy') NOT NULL DEFAULT 'sntp',
`contact_information` text,
`request_information` text,
`device_information` text,
`device_count` int(10) unsigned DEFAULT NULL,
`device_count` int unsigned DEFAULT NULL,
`opensource` tinyint(1) NOT NULL DEFAULT '0',
`opensource_info` text,
`rt_ticket` smallint(5) unsigned DEFAULT NULL,
`rt_ticket` smallint unsigned DEFAULT NULL,
`approved_on` datetime DEFAULT NULL,
`created_on` datetime NOT NULL,
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`dns_root_id` int(10) unsigned NOT NULL,
`account_id` int(10) unsigned DEFAULT NULL,
`dns_root_id` int unsigned NOT NULL,
`account_id` int unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `zone_name` (`zone_name`,`dns_root_id`),
KEY `vendor_zones_user_id` (`user_id`),
@@ -708,7 +767,7 @@ CREATE TABLE `vendor_zones` (
CONSTRAINT `dns_root_fk` FOREIGN KEY (`dns_root_id`) REFERENCES `dns_roots` (`id`),
CONSTRAINT `vendor_zone_account_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
CONSTRAINT `vendor_zones_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -719,18 +778,18 @@ DROP TABLE IF EXISTS `zone_server_counts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `zone_server_counts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`zone_id` int(10) unsigned NOT NULL,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`zone_id` int unsigned NOT NULL,
`ip_version` enum('v4','v6') NOT NULL,
`date` date NOT NULL,
`count_active` mediumint(8) unsigned NOT NULL,
`count_registered` mediumint(8) unsigned NOT NULL,
`netspeed_active` int(10) unsigned NOT NULL,
`count_active` mediumint unsigned NOT NULL,
`count_registered` mediumint unsigned NOT NULL,
`netspeed_active` int unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `zone_date` (`zone_id`,`date`,`ip_version`),
KEY `date_idx` (`date`,`zone_id`),
CONSTRAINT `zone_server_counts` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -741,16 +800,16 @@ DROP TABLE IF EXISTS `zones`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `zones` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`parent_id` int(10) unsigned DEFAULT NULL,
`parent_id` int unsigned DEFAULT NULL,
`dns` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
KEY `parent` (`parent_id`),
CONSTRAINT `zones_parent` FOREIGN KEY (`parent_id`) REFERENCES `zones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -765,7 +824,7 @@ CREATE TABLE `zones` (
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */
/*!50013 DEFINER=`v-root-ntp-askntp-JRFPjVcaH1HOoQ`@`10.%` SQL SECURITY DEFINER */
/*!50001 VIEW `monitors_data` AS select `monitors`.`id` AS `id`,`monitors`.`account_id` AS `account_id`,`monitors`.`type` AS `type`,if((`monitors`.`type` = 'score'),`monitors`.`name`,substring_index(`monitors`.`tls_name`,'.',1)) AS `name`,`monitors`.`ip` AS `ip`,`monitors`.`ip_version` AS `ip_version`,`monitors`.`status` AS `status`,`monitors`.`client_version` AS `client_version`,`monitors`.`last_seen` AS `last_seen`,`monitors`.`last_submit` AS `last_submit` from `monitors` where (not((`monitors`.`tls_name` like '%.system'))) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
@@ -778,6 +837,6 @@ CREATE TABLE `zones` (
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
-- Dump completed on 2024-03-16 17:43:33
-- Dump completed on 2025-01-18 4:31:13