[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
xampp
/
htdocs
/
repository_afbs
/
[
Home
]
File: repository_afbs (1).sql
-- phpMyAdmin SQL Dump -- version 5.2.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Feb 13, 2026 at 07:57 AM -- Server version: 10.4.27-MariaDB -- PHP Version: 7.4.33 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: `repository_afbs` -- -- -------------------------------------------------------- -- -- Table structure for table `activities_log` -- CREATE TABLE `activities_log` ( `id` bigint(20) NOT NULL, `user_id` int(11) DEFAULT NULL, `action_type` enum('login','logout','upload','download','view','approve','reject','edit','delete') DEFAULT NULL, `thesis_id` int(11) DEFAULT NULL, `description` text DEFAULT NULL, `ip_address` varchar(45) DEFAULT NULL, `user_agent` text DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `activities_log` -- INSERT INTO `activities_log` (`id`, `user_id`, `action_type`, `thesis_id`, `description`, `ip_address`, `user_agent`, `created_at`) VALUES (1, 1, 'upload', 1, 'Upload tugas akhir: Uji Aktivitas Antibakteri Ekstrak Daun Sirsak (Annona muricata L.) Terhadap Bakteri Staphylococcus aureus', 'system', NULL, '2026-02-13 06:13:02'); -- -------------------------------------------------------- -- -- Table structure for table `announcements` -- CREATE TABLE `announcements` ( `id` int(11) NOT NULL, `title` varchar(255) NOT NULL, `content` text NOT NULL, `type` enum('info','warning','success','danger') DEFAULT 'info', `is_published` tinyint(1) DEFAULT 1, `published_at` timestamp NULL DEFAULT NULL, `expires_at` timestamp NULL DEFAULT NULL, `created_by` int(11) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` int(11) NOT NULL, `name` varchar(100) NOT NULL, `slug` varchar(110) NOT NULL, `description` text DEFAULT NULL, `parent_id` int(11) DEFAULT NULL, `icon` varchar(50) DEFAULT NULL, `sort_order` int(11) DEFAULT 0, `is_active` tinyint(1) DEFAULT 1, `created_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`id`, `name`, `slug`, `description`, `parent_id`, `icon`, `sort_order`, `is_active`, `created_at`) VALUES (1, 'Farmakologi', 'farmakologi', 'Bidang ilmu farmakologi', NULL, NULL, 0, 1, '2026-02-13 06:13:02'), (2, 'Farmasetika', 'farmasetika', 'Bidang ilmu farmasetika', NULL, NULL, 0, 1, '2026-02-13 06:13:02'), (3, 'Kimia Farmasi', 'kimia-farmasi', 'Bidang ilmu kimia farmasi', NULL, NULL, 0, 1, '2026-02-13 06:13:02'); -- -------------------------------------------------------- -- -- Table structure for table `downloads_log` -- CREATE TABLE `downloads_log` ( `id` bigint(20) NOT NULL, `thesis_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `downloaded_at` timestamp NOT NULL DEFAULT current_timestamp(), `ip_address` varchar(45) DEFAULT NULL, `user_agent` text DEFAULT NULL, `session_id` varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `journals` -- CREATE TABLE `journals` ( `id` int(11) NOT NULL, `title` varchar(255) NOT NULL, `volume` varchar(50) DEFAULT NULL, `issue` varchar(50) DEFAULT NULL, `year` year(4) DEFAULT NULL, `month` varchar(20) DEFAULT NULL, `description` text DEFAULT NULL, `cover_image` varchar(255) DEFAULT NULL, `pdf_file` varchar(255) DEFAULT NULL, `is_published` tinyint(1) DEFAULT 0, `published_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `settings` -- CREATE TABLE `settings` ( `id` int(11) NOT NULL, `setting_key` varchar(100) NOT NULL, `setting_value` text DEFAULT NULL, `setting_group` varchar(50) DEFAULT 'general', `description` text DEFAULT NULL, `is_public` tinyint(1) DEFAULT 0, `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `theses` -- CREATE TABLE `theses` ( `id` int(11) NOT NULL, `title` varchar(500) NOT NULL, `slug` varchar(550) DEFAULT NULL, `abstract` text NOT NULL, `author_id` int(11) NOT NULL, `authors` varchar(255) NOT NULL, `year` year(4) NOT NULL, `program_study` varchar(100) DEFAULT 'Farmasi', `supervisor1` varchar(100) NOT NULL, `supervisor2` varchar(100) DEFAULT NULL, `supervisor1_nidn` varchar(20) DEFAULT NULL, `supervisor2_nidn` varchar(20) DEFAULT NULL, `examiner1` varchar(100) NOT NULL, `examiner2` varchar(100) DEFAULT NULL, `examiner1_nidn` varchar(20) DEFAULT NULL, `examiner2_nidn` varchar(20) DEFAULT NULL, `keywords` varchar(500) NOT NULL, `doi` varchar(100) DEFAULT NULL, `isbn_issn` varchar(50) DEFAULT NULL, `language` varchar(10) DEFAULT 'id', `pages` int(11) DEFAULT NULL, `file_size` int(11) DEFAULT NULL, `pdf_file` varchar(255) NOT NULL, `cover_image` varchar(255) DEFAULT NULL, `supplementary_files` text DEFAULT NULL, `views` int(11) DEFAULT 0, `downloads` int(11) DEFAULT 0, `status` enum('pending','review','revision','approved','rejected','archived') DEFAULT 'pending', `rejection_reason` text DEFAULT NULL, `notes` text DEFAULT NULL, `submitted_at` timestamp NOT NULL DEFAULT current_timestamp(), `reviewed_at` timestamp NULL DEFAULT NULL, `approved_at` timestamp NULL DEFAULT NULL, `approved_by` int(11) DEFAULT NULL, `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `theses` -- INSERT INTO `theses` (`id`, `title`, `slug`, `abstract`, `author_id`, `authors`, `year`, `program_study`, `supervisor1`, `supervisor2`, `supervisor1_nidn`, `supervisor2_nidn`, `examiner1`, `examiner2`, `examiner1_nidn`, `examiner2_nidn`, `keywords`, `doi`, `isbn_issn`, `language`, `pages`, `file_size`, `pdf_file`, `cover_image`, `supplementary_files`, `views`, `downloads`, `status`, `rejection_reason`, `notes`, `submitted_at`, `reviewed_at`, `approved_at`, `approved_by`, `updated_at`) VALUES (1, 'Uji Aktivitas Antibakteri Ekstrak Daun Sirsak (Annona muricata L.) Terhadap Bakteri Staphylococcus aureus', 'uji-aktivitas-antibakteri-ekstrak-daun-sirsak-(annona-muricata-l.)-terhadap-bakteri-staphylococcus-aureus-0', 'Penelitian ini bertujuan untuk mengetahui aktivitas antibakteri...', 1, 'Siti Nurhaliza', 2024, 'Farmasi', 'apt. Rina, M.Farm', NULL, NULL, NULL, 'Dr. Budi Santoso', NULL, NULL, NULL, 'Antibakteri, Daun Sirsak, Staphylococcus aureus', NULL, NULL, 'id', NULL, NULL, 'thesis_1901001_2024.pdf', NULL, NULL, 0, 0, 'approved', NULL, NULL, '2026-02-13 06:13:02', NULL, NULL, NULL, '2026-02-13 06:13:02'); -- -- Triggers `theses` -- DELIMITER $$ CREATE TRIGGER `generate_thesis_slug` BEFORE INSERT ON `theses` FOR EACH ROW BEGIN SET NEW.slug = LOWER(REPLACE(CONCAT(NEW.title, '-', NEW.id), ' ', '-')); END $$ DELIMITER ; DELIMITER $$ CREATE TRIGGER `log_thesis_upload` AFTER INSERT ON `theses` FOR EACH ROW BEGIN INSERT INTO activities_log (user_id, action_type, thesis_id, description, ip_address) VALUES (NEW.author_id, 'upload', NEW.id, CONCAT('Upload tugas akhir: ', NEW.title), 'system'); END $$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `thesis_categories` -- CREATE TABLE `thesis_categories` ( `thesis_id` int(11) NOT NULL, `category_id` int(11) NOT NULL, `assigned_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `thesis_reviews` -- CREATE TABLE `thesis_reviews` ( `id` int(11) NOT NULL, `thesis_id` int(11) NOT NULL, `reviewer_id` int(11) NOT NULL, `review_status` enum('pending','approved','revision','rejected') DEFAULT 'pending', `comments` text DEFAULT NULL, `score` decimal(3,2) DEFAULT NULL, `reviewed_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `username` varchar(50) NOT NULL, `email` varchar(100) NOT NULL, `password` varchar(255) NOT NULL, `full_name` varchar(100) NOT NULL, `nim` varchar(20) DEFAULT NULL, `program_studi` varchar(50) DEFAULT 'Farmasi', `angkatan` year(4) DEFAULT NULL, `no_telepon` varchar(15) DEFAULT NULL, `alamat` text DEFAULT NULL, `foto_profil` varchar(255) DEFAULT NULL, `role` enum('admin','mahasiswa','dosen','umum') DEFAULT 'mahasiswa', `is_active` tinyint(1) DEFAULT 1, `last_login` timestamp NULL DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `email`, `password`, `full_name`, `nim`, `program_studi`, `angkatan`, `no_telepon`, `alamat`, `foto_profil`, `role`, `is_active`, `last_login`, `created_at`, `updated_at`) VALUES (1, '1901001', '1901001@afbs.ac.id', '$2y$10$YourHashedPassword', 'Siti Nurhaliza', '1901001', 'Farmasi', NULL, NULL, NULL, NULL, 'mahasiswa', 1, NULL, '2026-02-13 06:13:02', '2026-02-13 06:13:02'), (2, '1901002', '1901002@afbs.ac.id', '$2y$10$YourHashedPassword', 'Ahmad Fauzi', '1901002', 'Farmasi', NULL, NULL, NULL, NULL, 'mahasiswa', 1, NULL, '2026-02-13 06:13:02', '2026-02-13 06:13:02'), (3, 'drsupardi', 'dr.supardi@afbs.ac.id', '$2y$10$YourHashedPassword', 'Dr. Supardi, M.Si', NULL, 'Farmasi', NULL, NULL, NULL, NULL, 'dosen', 1, NULL, '2026-02-13 06:13:02', '2026-02-13 06:13:02'); -- -------------------------------------------------------- -- -- Stand-in structure for view `v_repository_stats` -- (See below for the actual view) -- CREATE TABLE `v_repository_stats` ( `total_theses` bigint(21) ,`total_authors` bigint(21) ,`total_views` decimal(32,0) ,`total_downloads` decimal(32,0) ,`total_years` bigint(21) ); -- -------------------------------------------------------- -- -- Stand-in structure for view `v_top_downloads` -- (See below for the actual view) -- CREATE TABLE `v_top_downloads` ( `id` int(11) ,`title` varchar(500) ,`authors` varchar(255) ,`downloads` int(11) ,`views` int(11) ,`uploader` varchar(100) ); -- -------------------------------------------------------- -- -- Structure for view `v_repository_stats` -- DROP TABLE IF EXISTS `v_repository_stats`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_repository_stats` AS SELECT count(distinct `t`.`id`) AS `total_theses`, count(distinct `t`.`author_id`) AS `total_authors`, sum(`t`.`views`) AS `total_views`, sum(`t`.`downloads`) AS `total_downloads`, count(distinct year(`t`.`submitted_at`)) AS `total_years` FROM `theses` AS `t` WHERE `t`.`status` = 'approved''approved' ; -- -------------------------------------------------------- -- -- Structure for view `v_top_downloads` -- DROP TABLE IF EXISTS `v_top_downloads`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_top_downloads` AS SELECT `t`.`id` AS `id`, `t`.`title` AS `title`, `t`.`authors` AS `authors`, `t`.`downloads` AS `downloads`, `t`.`views` AS `views`, `u`.`full_name` AS `uploader` FROM (`theses` `t` join `users` `u` on(`t`.`author_id` = `u`.`id`)) WHERE `t`.`status` = 'approved' ORDER BY `t`.`downloads` DESC LIMIT 0, 1010 ; -- -- Indexes for dumped tables -- -- -- Indexes for table `activities_log` -- ALTER TABLE `activities_log` ADD PRIMARY KEY (`id`), ADD KEY `thesis_id` (`thesis_id`), ADD KEY `idx_user` (`user_id`), ADD KEY `idx_action` (`action_type`), ADD KEY `idx_date` (`created_at`), ADD KEY `idx_activities_user_action` (`user_id`,`action_type`); -- -- Indexes for table `announcements` -- ALTER TABLE `announcements` ADD PRIMARY KEY (`id`), ADD KEY `created_by` (`created_by`), ADD KEY `idx_published` (`is_published`,`published_at`); -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `slug` (`slug`), ADD KEY `idx_parent` (`parent_id`), ADD KEY `idx_slug` (`slug`); -- -- Indexes for table `downloads_log` -- ALTER TABLE `downloads_log` ADD PRIMARY KEY (`id`), ADD KEY `idx_thesis` (`thesis_id`), ADD KEY `idx_user` (`user_id`), ADD KEY `idx_date` (`downloaded_at`), ADD KEY `idx_downloads_thesis_user` (`thesis_id`,`user_id`); -- -- Indexes for table `journals` -- ALTER TABLE `journals` ADD PRIMARY KEY (`id`); -- -- Indexes for table `settings` -- ALTER TABLE `settings` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `setting_key` (`setting_key`); -- -- Indexes for table `theses` -- ALTER TABLE `theses` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `slug` (`slug`), ADD UNIQUE KEY `doi` (`doi`), ADD KEY `approved_by` (`approved_by`), ADD KEY `idx_title` (`title`(255)), ADD KEY `idx_year` (`year`), ADD KEY `idx_status` (`status`), ADD KEY `idx_author` (`author_id`), ADD KEY `idx_keywords` (`keywords`(255)), ADD KEY `idx_theses_status_year` (`status`,`year`), ADD KEY `idx_theses_author_status` (`author_id`,`status`); ALTER TABLE `theses` ADD FULLTEXT KEY `ft_search` (`title`,`abstract`,`keywords`); ALTER TABLE `theses` ADD FULLTEXT KEY `ft_theses_search` (`title`,`abstract`,`keywords`); -- -- Indexes for table `thesis_categories` -- ALTER TABLE `thesis_categories` ADD PRIMARY KEY (`thesis_id`,`category_id`), ADD KEY `category_id` (`category_id`); -- -- Indexes for table `thesis_reviews` -- ALTER TABLE `thesis_reviews` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `unique_review` (`thesis_id`,`reviewer_id`), ADD KEY `reviewer_id` (`reviewer_id`), ADD KEY `idx_thesis` (`thesis_id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `username` (`username`), ADD UNIQUE KEY `email` (`email`), ADD UNIQUE KEY `nim` (`nim`), ADD KEY `idx_email` (`email`), ADD KEY `idx_nim` (`nim`), ADD KEY `idx_role` (`role`); ALTER TABLE `users` ADD FULLTEXT KEY `ft_users_search` (`full_name`,`email`,`nim`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `activities_log` -- ALTER TABLE `activities_log` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `announcements` -- ALTER TABLE `announcements` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `categories` -- ALTER TABLE `categories` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `downloads_log` -- ALTER TABLE `downloads_log` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `journals` -- ALTER TABLE `journals` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `settings` -- ALTER TABLE `settings` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `theses` -- ALTER TABLE `theses` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `thesis_reviews` -- ALTER TABLE `thesis_reviews` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- Constraints for dumped tables -- -- -- Constraints for table `activities_log` -- ALTER TABLE `activities_log` ADD CONSTRAINT `activities_log_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL, ADD CONSTRAINT `activities_log_ibfk_2` FOREIGN KEY (`thesis_id`) REFERENCES `theses` (`id`) ON DELETE SET NULL; -- -- Constraints for table `announcements` -- ALTER TABLE `announcements` ADD CONSTRAINT `announcements_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `categories` -- ALTER TABLE `categories` ADD CONSTRAINT `categories_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE; -- -- Constraints for table `downloads_log` -- ALTER TABLE `downloads_log` ADD CONSTRAINT `downloads_log_ibfk_1` FOREIGN KEY (`thesis_id`) REFERENCES `theses` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `downloads_log_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `theses` -- ALTER TABLE `theses` ADD CONSTRAINT `theses_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `theses_ibfk_2` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL; -- -- Constraints for table `thesis_categories` -- ALTER TABLE `thesis_categories` ADD CONSTRAINT `thesis_categories_ibfk_1` FOREIGN KEY (`thesis_id`) REFERENCES `theses` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `thesis_categories_ibfk_2` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE; -- -- Constraints for table `thesis_reviews` -- ALTER TABLE `thesis_reviews` ADD CONSTRAINT `thesis_reviews_ibfk_1` FOREIGN KEY (`thesis_id`) REFERENCES `theses` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `thesis_reviews_ibfk_2` FOREIGN KEY (`reviewer_id`) REFERENCES `users` (`id`) ON DELETE 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 */;