-
Notifications
You must be signed in to change notification settings - Fork 1
/
buah_ht.sql
195 lines (159 loc) · 5.24 KB
/
buah_ht.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 29, 2021 at 09:23 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!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 utf8mb4 */;
--
-- Database: `buah_ht`
--
-- --------------------------------------------------------
--
-- Table structure for table `absensi`
--
CREATE TABLE `absensi` (
`id_absensi` int(100) NOT NULL,
`id_users` int(100) NOT NULL,
`tanggal_masuk` date NOT NULL,
`tanggal_keluar` time NOT NULL,
`jam_masuk` time NOT NULL,
`jam_keluar` varchar(255) NOT NULL,
`status` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `divisi`
--
CREATE TABLE `divisi` (
`id_divisi` int(100) NOT NULL,
`nama_divisi` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `divisi`
--
INSERT INTO `divisi` (`id_divisi`, `nama_divisi`) VALUES
(1, 'HRD'),
(2, 'IT');
-- --------------------------------------------------------
--
-- Table structure for table `role`
--
CREATE TABLE `role` (
`id_role` int(100) NOT NULL,
`nama_role` varchar(100) NOT NULL,
`deskripsi_role` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `role`
--
INSERT INTO `role` (`id_role`, `nama_role`, `deskripsi_role`) VALUES
(1, 'admin', 'mengatur seluruh sistem'),
(2, 'user', 'karyawan biasa');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id_users` int(100) NOT NULL,
`id_role` int(100) NOT NULL,
`id_divisi` int(100) NOT NULL,
`nik` varchar(50) NOT NULL,
`email` varchar(100) NOT NULL,
`username` varchar(100) NOT NULL,
`alamat` varchar(255) NOT NULL,
`no_tlp` varchar(13) NOT NULL,
`agama` varchar(50) DEFAULT NULL,
`status_tinggal` varchar(100) DEFAULT NULL,
`gol_darah` varchar(50) DEFAULT NULL,
`warga` varchar(50) DEFAULT NULL,
`ktp` varchar(50) DEFAULT NULL,
`npwp` varchar(50) DEFAULT NULL,
`password` varchar(255) NOT NULL,
`is_active` enum('true','false','') NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id_users`, `id_role`, `id_divisi`, `nik`, `email`, `username`, `alamat`, `no_tlp`, `agama`, `status_tinggal`, `gol_darah`, `warga`, `ktp`, `npwp`, `password`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 1, 1, '81828120109', 'rinda@gmail.com', 'Rinda', 'JL.PASAR SASAK CILEDUK JAYA', '0812812828', NULL, NULL, NULL, NULL, NULL, NULL, '2807266b476de7e2969e5f6669a225ac', 'true', '2021-10-24 16:46:10', '0000-00-00 00:00:00'),
(3, 2, 2, '2016148799', 'neiji@gmail.com', 'Neiji', 'JL.PANGUYUBUAN RAYA BARAT 2', '089182718188', NULL, NULL, NULL, NULL, NULL, NULL, '3d3eb22ed9e275a262a6eadded25eebc', 'true', '2021-10-26 07:59:42', NULL),
(4, 2, 2, '121212', 'njin@gmail.com', 'Njin', 'JL.PASURUAN BARAT', '0812818281', 'Islam', 'Orangtua', 'A', 'Indonesia', '01281821212', '8121827172', 'a889aa282c4e893bbe5ce82efda5804a', 'true', '2021-10-29 13:07:56', NULL);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `absensi`
--
ALTER TABLE `absensi`
ADD PRIMARY KEY (`id_absensi`),
ADD KEY `id_users` (`id_users`);
--
-- Indexes for table `divisi`
--
ALTER TABLE `divisi`
ADD PRIMARY KEY (`id_divisi`);
--
-- Indexes for table `role`
--
ALTER TABLE `role`
ADD PRIMARY KEY (`id_role`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id_users`),
ADD KEY `id_role` (`id_role`),
ADD KEY `id_role_2` (`id_role`),
ADD KEY `id_divisi` (`id_divisi`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `absensi`
--
ALTER TABLE `absensi`
MODIFY `id_absensi` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `divisi`
--
ALTER TABLE `divisi`
MODIFY `id_divisi` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `role`
--
ALTER TABLE `role`
MODIFY `id_role` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id_users` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `absensi`
--
ALTER TABLE `absensi`
ADD CONSTRAINT `absensi_ibfk_1` FOREIGN KEY (`id_users`) REFERENCES `users` (`id_users`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `users`
--
ALTER TABLE `users`
ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`id_divisi`) REFERENCES `divisi` (`id_divisi`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `users_ibfk_2` FOREIGN KEY (`id_role`) REFERENCES `role` (`id_role`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
/*!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 */;