diff --git a/.gitignore b/.gitignore index 442b1cf4a..2142b9d08 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,6 @@ vendor/ *.iso *.jar *.rar -*.sql *.tar *.zip diff --git a/contrib/database-init.sql b/contrib/database-init.sql new file mode 100644 index 000000000..022d0857c --- /dev/null +++ b/contrib/database-init.sql @@ -0,0 +1,276 @@ +-- MySQL dump 10.13 Distrib 5.7.34, for Linux (x86_64) +-- +-- Host: localhost Database: thetool2 +-- ------------------------------------------------------ +-- Server version 5.7.34-0ubuntu0.18.04.1 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!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 */; + +-- +-- Table structure for table `Address` +-- + +DROP TABLE IF EXISTS `Address`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Address` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `parent_id` int(11) DEFAULT NULL, + `company` text COLLATE utf8mb4_unicode_520_ci NOT NULL, + `firstname` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `lastname` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `street` text COLLATE utf8mb4_unicode_520_ci NOT NULL, + `zip` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `city` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `country` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `phone` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `fax` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `mobile` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `email` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `note` text COLLATE utf8mb4_unicode_520_ci NOT NULL, + `create_by` int(11) NOT NULL, + `edit_by` int(11) NOT NULL, + `create` int(10) NOT NULL, + `edit` int(10) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Address` +-- + +LOCK TABLES `Address` WRITE; +/*!40000 ALTER TABLE `Address` DISABLE KEYS */; +/*!40000 ALTER TABLE `Address` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Addressattribute` +-- + +DROP TABLE IF EXISTS `Addressattribute`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Addressattribute` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `address_id` int(11) NOT NULL, + `name` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `value` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `create_by` int(11) NOT NULL, + `edit_by` int(11) NOT NULL, + `create` int(11) NOT NULL, + `edit` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Addressattribute` +-- + +LOCK TABLES `Addressattribute` WRITE; +/*!40000 ALTER TABLE `Addressattribute` DISABLE KEYS */; +/*!40000 ALTER TABLE `Addressattribute` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Addresstype` +-- + +DROP TABLE IF EXISTS `Addresstype`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Addresstype` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `address_id` int(11) NOT NULL, + `type` enum('systemowner','netowner','salespartner','pipeworker','lineworker','netoperator','support','billing','employee','customer','supplier','contact') COLLATE utf8mb4_unicode_520_ci NOT NULL, + `primary` tinyint(1) NOT NULL DEFAULT '0', + `note` text COLLATE utf8mb4_unicode_520_ci, + `create_by` int(11) NOT NULL, + `edit_by` int(11) NOT NULL, + `create` int(10) NOT NULL, + `edit` int(10) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Addresstype` +-- + +LOCK TABLES `Addresstype` WRITE; +/*!40000 ALTER TABLE `Addresstype` DISABLE KEYS */; +/*!40000 ALTER TABLE `Addresstype` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Network` +-- + +DROP TABLE IF EXISTS `Network`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Network` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `owner_id` int(11) NOT NULL, + `note` text COLLATE utf8mb4_unicode_520_ci, + `create_by` int(11) NOT NULL, + `edit_by` int(11) NOT NULL, + `create` int(10) NOT NULL, + `edit` int(10) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Network` +-- + +LOCK TABLES `Network` WRITE; +/*!40000 ALTER TABLE `Network` DISABLE KEYS */; +/*!40000 ALTER TABLE `Network` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Pop` +-- + +DROP TABLE IF EXISTS `Pop`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Pop` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `network_id` int(11) NOT NULL, + `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `gps_lat` decimal(15,10) DEFAULT NULL, + `gps_long` decimal(15,10) DEFAULT NULL, + `location` text COLLATE utf8mb4_unicode_520_ci, + `note` text COLLATE utf8mb4_unicode_520_ci, + `create_by` int(11) NOT NULL, + `edit_by` int(11) NOT NULL, + `create` int(10) NOT NULL, + `edit` int(10) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Pop` +-- + +LOCK TABLES `Pop` WRITE; +/*!40000 ALTER TABLE `Pop` DISABLE KEYS */; +/*!40000 ALTER TABLE `Pop` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Worker` +-- + +DROP TABLE IF EXISTS `Worker`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Worker` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `address_id` int(11) NOT NULL, + `username` varchar(255) CHARACTER SET utf8mb4 NOT NULL, + `password` varchar(56) CHARACTER SET utf8mb4 NOT NULL, + `name` varchar(255) CHARACTER SET utf8mb4 NOT NULL, + `email` varchar(255) CHARACTER SET utf8mb4 NOT NULL, + `ip` varchar(39) CHARACTER SET utf8mb4 DEFAULT NULL, + `sessionid` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, + `create_by` int(11) NOT NULL, + `edit_by` int(11) NOT NULL, + `create` int(10) NOT NULL, + `edit` int(10) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Worker` +-- + +LOCK TABLES `Worker` WRITE; +/*!40000 ALTER TABLE `Worker` DISABLE KEYS */; +INSERT INTO `Worker` VALUES (1,1,'admin','e3823cb9c12137166c9e71978e8383b96300d0e6f46d1c902b794d95','Admin I. Strator','root@localhost',NULL,NULL,1,1,1520600652,1604674421); +/*!40000 ALTER TABLE `Worker` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `WorkerFlag` +-- + +DROP TABLE IF EXISTS `WorkerFlag`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `WorkerFlag` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `worker_id` int(11) NOT NULL, + `name` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `value` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `create_by` int(11) NOT NULL, + `edit_by` int(11) NOT NULL, + `create` int(11) NOT NULL, + `edit` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `WorkerFlag` +-- + +LOCK TABLES `WorkerFlag` WRITE; +/*!40000 ALTER TABLE `WorkerFlag` DISABLE KEYS */; +/*!40000 ALTER TABLE `WorkerFlag` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `WorkerPermission` +-- + +DROP TABLE IF EXISTS `WorkerPermission`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `WorkerPermission` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `worker_id` int(11) NOT NULL, + `admin` enum('false','true') COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'false', + `create` int(10) NOT NULL, + `edit` int(10) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `WorkerPermission` +-- + +LOCK TABLES `WorkerPermission` WRITE; +/*!40000 ALTER TABLE `WorkerPermission` DISABLE KEYS */; +INSERT INTO `WorkerPermission` VALUES (1,1,'true',1549970701,1604674421); +/*!40000 ALTER TABLE `WorkerPermission` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!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 */; + +-- Dump completed on 2021-06-24 20:10:17 diff --git a/contrib/migrations/20210629-01-addresstype-planner-vlan.sql b/contrib/migrations/20210629-01-addresstype-planner-vlan.sql new file mode 100644 index 000000000..5c7f7b473 --- /dev/null +++ b/contrib/migrations/20210629-01-addresstype-planner-vlan.sql @@ -0,0 +1,5 @@ +ALTER TABLE `Addresstype` CHANGE `type` `type` ENUM('systemowner','netowner','salespartner','pipeworker','lineworker','netoperator','planner','support','billing','employee','customer','supplier','contact'); +ALTER TABLE `Pop` ADD `vlan_public` INT(4) NULL DEFAULT NULL AFTER `location`; +ALTER TABLE `Pop` ADD `vlan_nat` INT(4) NULL DEFAULT NULL AFTER `vlan_public`; +ALTER TABLE `Pop` ADD `vlan_ipv6` INT(4) NULL DEFAULT NULL AFTER `vlan_nat`; +