-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.sql
168 lines (153 loc) · 9.1 KB
/
database.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
-- MySQL dump 10.13 Distrib 8.0.31, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: uas_srk
-- ------------------------------------------------------
-- Server version 8.0.31-0ubuntu0.22.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 */;
/*!50503 SET NAMES utf8mb4 */;
/*!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 `job_applications`
--
DROP TABLE IF EXISTS `job_applications`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `job_applications` (
`id` int NOT NULL AUTO_INCREMENT,
`employee_id` int NOT NULL,
`job_id` int NOT NULL,
`status` enum('pending','interview','accepted','rejected') DEFAULT 'pending',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `job_applications_jobs_null_fk` (`job_id`),
KEY `job_applications_users_null_fk` (`employee_id`),
CONSTRAINT `job_applications_jobs_null_fk` FOREIGN KEY (`job_id`) REFERENCES `jobs` (`id`),
CONSTRAINT `job_applications_users_null_fk` FOREIGN KEY (`employee_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `job_applications`
--
LOCK TABLES `job_applications` WRITE;
/*!40000 ALTER TABLE `job_applications` DISABLE KEYS */;
INSERT INTO `job_applications` VALUES (4,15,6,'accepted','2023-01-17 18:43:50'),(5,15,8,'pending','2023-01-17 19:28:04'),(6,16,6,'accepted','2023-01-18 00:24:08');
/*!40000 ALTER TABLE `job_applications` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `jobs`
--
DROP TABLE IF EXISTS `jobs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `jobs` (
`id` int NOT NULL AUTO_INCREMENT,
`company` varchar(255) NOT NULL,
`position` varchar(255) NOT NULL,
`description` text,
`years_of_experience` int NOT NULL,
`salary` int NOT NULL,
`applicants` int DEFAULT '0',
`recruiter_id` int NOT NULL,
`status` enum('open','closed') DEFAULT 'open',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `jobs_users_null_fk` (`recruiter_id`),
CONSTRAINT `jobs_users_null_fk` FOREIGN KEY (`recruiter_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `jobs`
--
LOCK TABLES `jobs` WRITE;
/*!40000 ALTER TABLE `jobs` DISABLE KEYS */;
INSERT INTO `jobs` VALUES (6,'PT Inovasi Teknologi Maju','Golang & Node.js Engineer','Have ability to use Golang & Node.js for web or service development. ',4,16000000,3,12,'open','2023-01-17 18:23:58','2023-01-18 00:31:52'),(8,'PT Sinar Mandiri','sales','-',0,2000000,1,11,'open','2023-01-17 19:27:37','2023-01-17 19:28:04');
/*!40000 ALTER TABLE `jobs` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(80) DEFAULT NULL,
`email` varchar(100) NOT NULL,
`password` text NOT NULL,
`roles` enum('employee','recruiter') NOT NULL DEFAULT 'employee',
`created_at` timestamp NOT NULL,
`updated_at` timestamp NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `users_email_uq` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (8,'Rizq Rofiq','rizqrofiq@gmail.com','$2b$10$ig9x5Q2mMPY4sn9QfCXtV.royBZU1BXmYdEJS0Ivr5ugq4Dhlf7aa','employee','2023-01-17 08:24:36','2023-01-17 08:24:36'),(9,'Jane Doe','janedoe@mail.com','$2b$10$ig9x5Q2mMPY4sn9QfCXtV.royBZU1BXmYdEJS0Ivr5ugq4Dhlf7aa','recruiter','2023-01-17 12:16:11','2023-01-17 12:16:25'),(11,'Diana Putri','diana@mail.com','$2b$10$GCr5sooiwYCNS1ew7lPLrul4B8PL..YyRGIx3Xy0gq8zTGYojpOmS','recruiter','2023-01-17 12:55:45','2023-01-17 12:55:45'),(12,'Eza Syahrul','eza@mail.com','$2b$10$LDTFYAmVI7tVdzKxfW08PuRUigh0V0.KDopPe.9Gu110CBJJ0wu1y','recruiter','2023-01-17 15:33:16','2023-01-17 15:33:16'),(13,'Dono Pribadi','pridono@mail.com','$2b$10$Ct/uoRBOEVQ/wtKdm.hHseThgu3DKz3umx8B3Frg1SeYYZRSTuLa6','employee','2023-01-17 16:01:07','2023-01-17 16:01:07'),(14,'Rizq Rofiq','rizqrofiq@mail.com','$2b$10$8pWXhBnL4ol9IJM.4j2zku0r9X4boyGZ6gzLQif.FiNL8XHUrha.S','employee','2023-01-17 18:42:38','2023-01-17 18:42:38'),(15,'Bima Aditya','bims@mail.com','$2b$10$VtoatW0SHlAm1Ux6.SubFOsa3RFtE0cg.3oQgkhIEPJYkZ7/X5OQW','employee','2023-01-17 18:43:32','2023-01-17 18:43:32'),(16,'John Doe','johndoe@mail.com','$2b$10$qfBZHjjIFQpTxyKqc5pzzOWfQ23oz622vXKJMrvDpqYm.NGhlJJ2G','employee','2023-01-18 00:21:59','2023-01-18 00:21:59'),(17,'Eza Sahril','ezasah@mail.com','$2b$10$P2AzSA/lqqD85f9OkDCPDOfsHCQ2ZOj4bO4Rb.5wW80VWKoqsG7b6','recruiter','2023-01-18 00:26:22','2023-01-18 00:26:22');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_0900_ai_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `DATETRIGER` BEFORE INSERT ON `users` FOR EACH ROW SET NEW.created_at = NOW() */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_0900_ai_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `UPDATETRIGER` BEFORE INSERT ON `users` FOR EACH ROW SET NEW.updated_at = NOW() */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_0900_ai_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `UPDATETIMETRIGER` BEFORE UPDATE ON `users` FOR EACH ROW SET NEW.updated_at = NOW() */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!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 2023-01-18 9:44:36