-- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Oct 08, 2020 at 12:11 PM -- Server version: 10.4.8-MariaDB -- PHP Version: 7.1.33 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; 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: `access_control` -- -- -------------------------------------------------------- -- -- Table structure for table `area` -- CREATE TABLE `area` ( `id` int(11) NOT NULL, `code` int(11) NOT NULL, `pid` int(11) NOT NULL DEFAULT 0, `name` varchar(100) NOT NULL, `description` text DEFAULT NULL, `created_at` int(11) NOT NULL DEFAULT 0, `modified_at` int(11) NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `area` -- INSERT INTO `area` (`id`, `code`, `pid`, `name`, `description`, `created_at`, `modified_at`) VALUES (1, 1, 0, 'AreaName', NULL, 0, 0); -- -------------------------------------------------------- -- -- Table structure for table `auth_assignment` -- CREATE TABLE `auth_assignment` ( `item_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `user_id` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `created_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `auth_assignment` -- INSERT INTO `auth_assignment` (`item_name`, `user_id`, `created_at`) VALUES ('administrator', '1', 1569900053); -- -------------------------------------------------------- -- -- Table structure for table `auth_item` -- CREATE TABLE `auth_item` ( `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `type` smallint(6) NOT NULL, `description` text COLLATE utf8_unicode_ci DEFAULT NULL, `rule_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `data` blob DEFAULT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `auth_item` -- INSERT INTO `auth_item` (`name`, `type`, `description`, `rule_name`, `data`, `created_at`, `updated_at`) VALUES ('administrator', 1, 'Administrator', NULL, NULL, 1535011160, 1535011160); -- -------------------------------------------------------- -- -- Table structure for table `auth_item_child` -- CREATE TABLE `auth_item_child` ( `parent` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `child` varchar(64) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `auth_rule` -- CREATE TABLE `auth_rule` ( `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `data` blob DEFAULT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `department` -- CREATE TABLE `department` ( `id` int(11) NOT NULL, `code` int(11) NOT NULL, `pid` int(11) NOT NULL, `name` varchar(100) NOT NULL, `created_at` int(11) NOT NULL, `modified_at` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `department` -- INSERT INTO `department` (`id`, `code`, `pid`, `name`, `created_at`, `modified_at`) VALUES (1, 1, 0, 'CompanyName', 0, 0), (2, 2, 1, 'Phòng CNTT', 1602151686, 1602151686), (3, 3, 2, 'Phòng AI', 1602151780, 1602151780), (4, 4, 2, 'Phòng OP', 1602151789, 1602151828); -- -------------------------------------------------------- -- -- Table structure for table `device` -- CREATE TABLE `device` ( `id` int(11) NOT NULL, `name` varchar(100) NOT NULL, `serial` varchar(50) DEFAULT NULL, `ip_address` varchar(20) NOT NULL, `status` int(11) NOT NULL, `type` int(11) NOT NULL, `area_id` int(11) NOT NULL, `created_at` int(11) NOT NULL DEFAULT 0, `modified_at` int(11) NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `system_logs` -- CREATE TABLE `system_logs` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `time` int(11) NOT NULL, `action` varchar(10) NOT NULL, `description` text NOT NULL, `type` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `system_logs` -- INSERT INTO `system_logs` (`id`, `user_id`, `time`, `action`, `description`, `type`) VALUES (1, 1, 1602151686, 'insert', 'Thêm mới phòng ban: Phòng CNTT', 'department'), (2, 1, 1602151780, 'insert', 'Thêm mới phòng ban: Phòng AI', 'department'), (3, 1, 1602151789, 'insert', 'Thêm mới phòng ban: Phòng OP', 'department'), (4, 1, 1602151794, 'update', 'Chỉnh sửa phòng ban: Phòng OP', 'department'), (5, 1, 1602151810, 'insert', 'Thêm mới phòng ban: gffdg', 'department'), (6, 1, 1602151813, 'delete', 'Xóa phòng ban: gffdg', 'department'), (7, 1, 1602151828, 'update', 'Chỉnh sửa phòng ban: Phòng OP', 'department'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id` int(11) NOT NULL, `first_name` varchar(250) NOT NULL, `last_name` varchar(250) DEFAULT NULL, `phone_number` varchar(30) DEFAULT NULL, `username` varchar(250) NOT NULL, `email` varchar(500) DEFAULT NULL, `password` varchar(250) NOT NULL, `authKey` varchar(250) DEFAULT NULL, `password_reset_token` varchar(250) DEFAULT NULL, `user_image` varchar(500) DEFAULT NULL, `quota` int(11) NOT NULL DEFAULT 2 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `first_name`, `last_name`, `phone_number`, `username`, `email`, `password`, `authKey`, `password_reset_token`, `user_image`, `quota`) VALUES (1, 'Administrator', '', '12313', 'admin', 'admin@bitraffic.vn', 'ceea23519f6f86ad67e9f798bf8002cb', NULL, NULL, '', 2); -- -- Indexes for dumped tables -- -- -- Indexes for table `area` -- ALTER TABLE `area` ADD PRIMARY KEY (`id`); -- -- Indexes for table `auth_assignment` -- ALTER TABLE `auth_assignment` ADD PRIMARY KEY (`item_name`,`user_id`), ADD KEY `auth_assignment_user_id_idx` (`user_id`); -- -- Indexes for table `auth_item` -- ALTER TABLE `auth_item` ADD PRIMARY KEY (`name`), ADD KEY `rule_name` (`rule_name`), ADD KEY `idx-auth_item-type` (`type`); -- -- Indexes for table `auth_item_child` -- ALTER TABLE `auth_item_child` ADD PRIMARY KEY (`parent`,`child`), ADD KEY `child` (`child`); -- -- Indexes for table `auth_rule` -- ALTER TABLE `auth_rule` ADD PRIMARY KEY (`name`); -- -- Indexes for table `department` -- ALTER TABLE `department` ADD PRIMARY KEY (`id`); -- -- Indexes for table `device` -- ALTER TABLE `device` ADD PRIMARY KEY (`id`); -- -- Indexes for table `system_logs` -- ALTER TABLE `system_logs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `username` (`username`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `area` -- ALTER TABLE `area` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `department` -- ALTER TABLE `department` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `device` -- ALTER TABLE `device` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `system_logs` -- ALTER TABLE `system_logs` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=202; -- -- Constraints for dumped tables -- -- -- Constraints for table `auth_item_child` -- ALTER TABLE `auth_item_child` ADD CONSTRAINT `auth_item_child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `auth_item_child_ibfk_2` FOREIGN KEY (`child`) REFERENCES `auth_item` (`name`) 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 */;