· 7 years ago · Oct 31, 2018, 06:34 AM
1CREATE DATABASE IF NOT EXISTS `final` /*!40100 DEFAULT CHARACTER SET utf8 */;
2USE `final`;
3-- MySQL dump 10.13 Distrib 5.6.13, for Win32 (x86)
4--
5-- Host: 127.0.0.1 Database: final
6-- ------------------------------------------------------
7-- Server version 5.7.17-log
8
9/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
11/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
12/*!40101 SET NAMES utf8 */;
13/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
14/*!40103 SET TIME_ZONE='+00:00' */;
15/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
16/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
17/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
18/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
19
20--
21-- Table structure for table `org_unit`
22--
23
24DROP TABLE IF EXISTS `org_unit`;
25/*!40101 SET @saved_cs_client = @@character_set_client */;
26/*!40101 SET character_set_client = utf8 */;
27CREATE TABLE `org_unit` (
28 `id` bigint(20) NOT NULL AUTO_INCREMENT,
29 `type` bigint(20) NOT NULL,
30 `code` varchar(45) DEFAULT NULL,
31 `name` varchar(45) DEFAULT NULL,
32 `led_by` bigint(20) DEFAULT NULL,
33 `parent` bigint(20) NOT NULL,
34 `order_rank` int(11) DEFAULT NULL,
35 PRIMARY KEY (`id`),
36 KEY `fk_org_unit_org_unit1_idx` (`parent`),
37 KEY `fk_org_unit_org_unit_type1` (`type`),
38 KEY `fk_org_unit_user1_idx` (`led_by`),
39 CONSTRAINT `fk_org_unit_led_by_user_id` FOREIGN KEY (`led_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
40 CONSTRAINT `fk_org_unit_org_unit_org_unit_id` FOREIGN KEY (`parent`) REFERENCES `org_unit` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
41 CONSTRAINT `fk_org_unit_type_org_unit_type_id` FOREIGN KEY (`type`) REFERENCES `org_unit_type` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
42) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
43/*!40101 SET character_set_client = @saved_cs_client */;
44
45--
46-- Dumping data for table `org_unit`
47--
48
49LOCK TABLES `org_unit` WRITE;
50/*!40000 ALTER TABLE `org_unit` DISABLE KEYS */;
51INSERT INTO `org_unit` VALUES (1,1,'ORG','Organization1',1,1,1),(2,2,'DEP1','DEPARTMENT1',2,1,2),(3,2,'DEP2','DEPARTMENT2',3,1,3),(4,2,'DEP3','DEPARTMENT3',5,1,3),(5,3,'SEC1','SECTION1',2,3,4),(6,3,'SEC2','SECTION2',2,4,4),(7,4,'UNT1','UNIT1',3,2,5),(8,4,'UNT2','UNIT2',NULL,1,1),(9,3,'SEC3','SECTION3',9,3,1),(10,5,'TEM2','TEAM2',4,7,6),(11,5,'TEM1','TEAM1',NULL,7,6),(12,4,'UNIT4','UNIT4',1,5,4),(13,5,'TEM3','TAEM3',1,12,5);
52/*!40000 ALTER TABLE `org_unit` ENABLE KEYS */;
53UNLOCK TABLES;
54
55--
56-- Table structure for table `user`
57--
58
59DROP TABLE IF EXISTS `user`;
60/*!40101 SET @saved_cs_client = @@character_set_client */;
61/*!40101 SET character_set_client = utf8 */;
62CREATE TABLE `user` (
63 `id` bigint(20) NOT NULL AUTO_INCREMENT,
64 `first_name` varchar(45) DEFAULT NULL,
65 `middle_name` varchar(45) DEFAULT NULL,
66 `last_name` varchar(45) DEFAULT NULL,
67 `date_of_birth` date DEFAULT NULL,
68 `mobile` varchar(45) DEFAULT NULL,
69 `email` varchar(45) DEFAULT NULL,
70 `blood_group` varchar(45) DEFAULT NULL,
71 `profile_image` varchar(255) DEFAULT NULL,
72 `date_of_join` date DEFAULT NULL,
73 `designation` varchar(45) DEFAULT NULL,
74 `work_location` varchar(45) DEFAULT NULL,
75 `reporting_manager` bigint(20) NOT NULL,
76 `org_unit` bigint(20) NOT NULL,
77 `personal_note` varchar(255) DEFAULT NULL,
78 `feeling` bigint(20) NOT NULL,
79 `order_rank` int(11) DEFAULT NULL,
80 `active` bit(1) DEFAULT NULL,
81 PRIMARY KEY (`id`),
82 KEY `fk_user_feeling1` (`feeling`),
83 KEY `fk_user_org_unit1` (`org_unit`),
84 KEY `fk_user_user` (`reporting_manager`),
85 CONSTRAINT `fk_user_feeling_feeling_id` FOREIGN KEY (`feeling`) REFERENCES `feeling` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
86 CONSTRAINT `fk_user_org_unit_org_unit_id` FOREIGN KEY (`org_unit`) REFERENCES `org_unit` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
87 CONSTRAINT `fk_user_reporting_manager_user_id` FOREIGN KEY (`reporting_manager`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
88) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
89/*!40101 SET character_set_client = @saved_cs_client */;
90
91--
92-- Dumping data for table `user`
93--
94
95LOCK TABLES `user` WRITE;
96/*!40000 ALTER TABLE `user` DISABLE KEYS */;
97INSERT INTO `user` VALUES (1,'Mohamed','Musni',NULL,'1989-12-17','0716351812','musni@gmail.com','O+','https://www.google.lk/seafdgfgfg','2010-02-10','CO','Colombo',1,1,'test1',1,1,''),(2,'kumuditha','tharanga',NULL,'1989-12-17','0716351812','kumuditha@gmail.lk','A+','https://www.google.lk/seafdgfgfg','2010-02-10','Engineer','Colombo',1,2,'test2',1,2,''),(3,'Yasas','ravin','Karunarathna','1985-12-22','0716351812','yasas@gmail.com','O+','https://www.google.lk/seafdgfgfg','2010-02-10','Consultant','Colombo',1,3,'test3',1,2,''),(4,'tharanga','hhhh','wew','1985-12-22','0766351812','tharanga@gmail.com','AB','https://www.google.lk/seafdgfgfg','2010-02-10','Senoir Engineer','Colombo',3,2,'test4',2,3,''),(5,'damith','asanka','eefe','1985-12-22','0766351111','damith@gmail.com','B+','https://www.google.lk/seafdgfgfg','2010-02-10','Engineer','Colombo',4,4,'test5',3,1,''),(6,'kasun','eee','ddd','1985-12-22','0766351111','kasun@gmail.com','','https://www.google.lk/seafdgfgfg','2011-03-10','Associate Enginner','Colombo',1,1,'test5',1,1,''),(7,'nimal','ewwre','fedfe','1985-12-22','0766351122','nimal@gmail.com','A+','https://www.google.lk/seafdgfgfg','2011-03-10','Senoir Engineer','Colombo',2,10,'test6',4,2,''),(8,'yasas','ravin',NULL,'1985-12-22','0766351122','ayasas@gmail.com','O+','https://www.google.lk/seafdgfgfg','2011-03-10','Senoir Engineer','Colombo',1,5,'test7',1,1,''),(9,'','ravin',NULL,'1985-12-22','0766351122','ayasas@gmail.com','A+','https://www.google.lk/seafdgfgfg','2011-03-10','Engineer','Colombo',2,9,'test8',1,1,''),(10,'kevin','perera',NULL,'1985-12-20','0766351111','kevins@gmail.com','O+','https://www.google.lk','2015-03-10','QA Enginner','CMB',2,9,'test9',1,2,''),(11,'namal','rupasinghe',NULL,'1985-12-20','0716351111','namal@gmail.com','A+','https://www.google.lk','2015-04-10','UI Engineer','ATC',3,3,'test10',1,1,''),(12,'ravin','pp','mm','1985-12-20','0716351111','ravin@gmail.com','O-','https://www.google.lk/yyyyyyyyyy','2014-04-10','QA Enginner','ATC',3,12,'test11',1,1,''),(13,'gayan','sampath','kk','1985-12-20','0713333333','gayan@gmail.com','B+','https://www.google.lk/yyyyyyyyyy','2014-04-18','Engineer','CMB',3,13,'test12',1,1,'');
98/*!40000 ALTER TABLE `user` ENABLE KEYS */;
99UNLOCK TABLES;
100
101--
102-- Table structure for table `org_unit_type`
103--
104
105DROP TABLE IF EXISTS `org_unit_type`;
106/*!40101 SET @saved_cs_client = @@character_set_client */;
107/*!40101 SET character_set_client = utf8 */;
108CREATE TABLE `org_unit_type` (
109 `id` bigint(20) NOT NULL AUTO_INCREMENT,
110 `name` varchar(255) DEFAULT NULL,
111 `display_name` varchar(255) DEFAULT NULL,
112 `plural_name` varchar(255) DEFAULT NULL,
113 PRIMARY KEY (`id`),
114 UNIQUE KEY `name_UNIQUE` (`name`)
115) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
116/*!40101 SET character_set_client = @saved_cs_client */;
117
118--
119-- Dumping data for table `org_unit_type`
120--
121
122LOCK TABLES `org_unit_type` WRITE;
123/*!40000 ALTER TABLE `org_unit_type` DISABLE KEYS */;
124INSERT INTO `org_unit_type` VALUES (1,'organization','Organization','Organizations'),(2,'department','Department','Departments'),(3,'section','Section','Sections'),(4,'unit','Unit','Units'),(5,'team','Team','Teams');
125/*!40000 ALTER TABLE `org_unit_type` ENABLE KEYS */;
126UNLOCK TABLES;
127/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
128
129/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
130/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
131/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
132/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
133/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
134/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
135/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
136
137-- Dump completed on 2018-10-31 11:49:41