522 lines
19 KiB
SQL
522 lines
19 KiB
SQL
-- MariaDB dump 10.19 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64)
|
|
--
|
|
-- Host: localhost Database: hsp_gdh
|
|
-- ------------------------------------------------------
|
|
-- Server version 10.11.6-MariaDB-0+deb12u1
|
|
|
|
/*!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 */;
|
|
/*!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 `appointments`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `appointments`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `appointments` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`patient_id` int(10) unsigned NOT NULL,
|
|
`doctor_id` int(10) unsigned NOT NULL,
|
|
`service_id` int(10) unsigned NOT NULL,
|
|
`hospital_id` int(10) unsigned DEFAULT NULL,
|
|
`room_id` int(10) unsigned DEFAULT NULL,
|
|
`date` date NOT NULL,
|
|
`time` time NOT NULL,
|
|
`status` enum('Confirmed','Completed','Absent','Cancelled by Patient','Cancelled by Doctor') NOT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `ap_patient_id_idx` (`patient_id`),
|
|
KEY `ap_doctor_id_idx` (`doctor_id`),
|
|
KEY `ap_service_id_idx` (`service_id`),
|
|
KEY `ap_hospital_id_idx` (`hospital_id`),
|
|
KEY `ap_room_id_idx` (`room_id`),
|
|
CONSTRAINT `ap_doctor_id` FOREIGN KEY (`doctor_id`) REFERENCES `doctors` (`id`) ON UPDATE CASCADE,
|
|
CONSTRAINT `ap_hospital_id` FOREIGN KEY (`hospital_id`) REFERENCES `hospitals` (`id`) ON UPDATE CASCADE,
|
|
CONSTRAINT `ap_patient_id` FOREIGN KEY (`patient_id`) REFERENCES `patients` (`id`) ON UPDATE CASCADE,
|
|
CONSTRAINT `ap_room_id` FOREIGN KEY (`room_id`) REFERENCES `rooms` (`id`) ON UPDATE CASCADE,
|
|
CONSTRAINT `ap_service_id` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON UPDATE CASCADE
|
|
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `appointments`
|
|
--
|
|
|
|
LOCK TABLES `appointments` WRITE;
|
|
/*!40000 ALTER TABLE `appointments` DISABLE KEYS */;
|
|
INSERT INTO `appointments` VALUES
|
|
(2,1,3,13,1,NULL,'2024-04-26','12:00:00','Confirmed');
|
|
/*!40000 ALTER TABLE `appointments` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `bans`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `bans`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `bans` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`user_id` int(10) unsigned NOT NULL,
|
|
`reason` text NOT NULL,
|
|
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
|
|
PRIMARY KEY (`id`),
|
|
KEY `bn_user_id_idx` (`user_id`),
|
|
CONSTRAINT `bn_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `bans`
|
|
--
|
|
|
|
LOCK TABLES `bans` WRITE;
|
|
/*!40000 ALTER TABLE `bans` DISABLE KEYS */;
|
|
/*!40000 ALTER TABLE `bans` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `companies`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `companies`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `companies` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`name` varchar(255) NOT NULL,
|
|
`code` varchar(2) NOT NULL,
|
|
`logo` varchar(255) DEFAULT NULL,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `companies`
|
|
--
|
|
|
|
LOCK TABLES `companies` WRITE;
|
|
/*!40000 ALTER TABLE `companies` DISABLE KEYS */;
|
|
INSERT INTO `companies` VALUES
|
|
(1,'Medical Test','MT',NULL);
|
|
/*!40000 ALTER TABLE `companies` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `doctors`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `doctors`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `doctors` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`user_id` int(10) unsigned NOT NULL,
|
|
`email` varchar(255) NOT NULL,
|
|
`phone` varchar(20) NOT NULL,
|
|
`speciality` varchar(255) NOT NULL,
|
|
`status` enum('Available','Absent','Unavailable') NOT NULL,
|
|
`is_verified` tinyint(1) NOT NULL DEFAULT 0,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `uc_doctor_user_id` (`user_id`),
|
|
KEY `dt_user_id_idx` (`user_id`),
|
|
CONSTRAINT `dt_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE CASCADE
|
|
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `doctors`
|
|
--
|
|
|
|
LOCK TABLES `doctors` WRITE;
|
|
/*!40000 ALTER TABLE `doctors` DISABLE KEYS */;
|
|
INSERT INTO `doctors` VALUES
|
|
(1,2,'test2@gmail.com','0123456789','Ophtalmo','Available',1),
|
|
(3,4,'doc1@doc.com','0123456789','TEST','Available',1);
|
|
/*!40000 ALTER TABLE `doctors` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `hospital_doctors`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `hospital_doctors`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `hospital_doctors` (
|
|
`hospital_id` int(10) unsigned NOT NULL,
|
|
`doctor_id` int(10) unsigned NOT NULL,
|
|
PRIMARY KEY (`hospital_id`,`doctor_id`),
|
|
KEY `hd_hospital_id_idx` (`hospital_id`),
|
|
KEY `hd_doctor_id_idx` (`doctor_id`),
|
|
CONSTRAINT `hd_doctor_id` FOREIGN KEY (`doctor_id`) REFERENCES `doctors` (`id`) ON UPDATE CASCADE,
|
|
CONSTRAINT `hd_hospital_id` FOREIGN KEY (`hospital_id`) REFERENCES `hospitals` (`id`) ON UPDATE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `hospital_doctors`
|
|
--
|
|
|
|
LOCK TABLES `hospital_doctors` WRITE;
|
|
/*!40000 ALTER TABLE `hospital_doctors` DISABLE KEYS */;
|
|
INSERT INTO `hospital_doctors` VALUES
|
|
(1,1),
|
|
(1,3);
|
|
/*!40000 ALTER TABLE `hospital_doctors` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `hospitals`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `hospitals`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `hospitals` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`company_id` int(10) unsigned NOT NULL,
|
|
`name` varchar(255) NOT NULL,
|
|
`code` varchar(3) NOT NULL,
|
|
`country` varchar(255) NOT NULL,
|
|
`region` varchar(255) NOT NULL,
|
|
`city` varchar(255) NOT NULL,
|
|
`address` varchar(255) NOT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `hs_company_id_idx` (`company_id`),
|
|
CONSTRAINT `hs_company_id` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON UPDATE CASCADE
|
|
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `hospitals`
|
|
--
|
|
|
|
LOCK TABLES `hospitals` WRITE;
|
|
/*!40000 ALTER TABLE `hospitals` DISABLE KEYS */;
|
|
INSERT INTO `hospitals` VALUES
|
|
(1,1,'Hopital Sud Paris','HSP','France','Île de France','Paris','4 Rue Ambroise Paré');
|
|
/*!40000 ALTER TABLE `hospitals` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `patients`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `patients`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `patients` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`user_id` int(10) unsigned NOT NULL,
|
|
`date_of_birth` date NOT NULL,
|
|
`gender` enum('M','F','O') NOT NULL,
|
|
`address` varchar(255) NOT NULL,
|
|
`social_security_number` varchar(128) NOT NULL,
|
|
`insurance_number` varchar(128) NOT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `uc_user_id` (`user_id`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `patients`
|
|
--
|
|
|
|
LOCK TABLES `patients` WRITE;
|
|
/*!40000 ALTER TABLE `patients` DISABLE KEYS */;
|
|
INSERT INTO `patients` VALUES
|
|
(1,1,'2003-03-03','M','2 rue du test','104099307303413','123456');
|
|
/*!40000 ALTER TABLE `patients` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `prescriptions`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `prescriptions`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `prescriptions` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`patient_id` int(10) unsigned NOT NULL,
|
|
`doctor_id` int(10) unsigned NOT NULL,
|
|
`appointment_id` int(10) unsigned NOT NULL,
|
|
`content` text NOT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `prescriptions_patient_idx` (`patient_id`),
|
|
KEY `prescriptions_doctor_idx` (`doctor_id`),
|
|
KEY `prescriptions_appointment_idx` (`appointment_id`),
|
|
CONSTRAINT `prescriptions_appointment_id` FOREIGN KEY (`appointment_id`) REFERENCES `appointments` (`id`) ON UPDATE CASCADE,
|
|
CONSTRAINT `prescriptions_doctor_id` FOREIGN KEY (`doctor_id`) REFERENCES `doctors` (`id`) ON UPDATE CASCADE,
|
|
CONSTRAINT `prescriptions_patient_id` FOREIGN KEY (`patient_id`) REFERENCES `patients` (`id`) ON UPDATE CASCADE
|
|
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `prescriptions`
|
|
--
|
|
|
|
LOCK TABLES `prescriptions` WRITE;
|
|
/*!40000 ALTER TABLE `prescriptions` DISABLE KEYS */;
|
|
INSERT INTO `prescriptions` VALUES
|
|
(8,1,3,2,'Test en légende');
|
|
/*!40000 ALTER TABLE `prescriptions` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `roles`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `roles`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `roles` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`name` varchar(255) NOT NULL,
|
|
`user_bitfield` int(10) unsigned NOT NULL,
|
|
`role_bitfield` int(10) unsigned NOT NULL,
|
|
`verification_code_bitfield` int(10) unsigned NOT NULL,
|
|
`ban_bitfield` int(10) unsigned NOT NULL,
|
|
`patient_bitfield` int(10) unsigned NOT NULL,
|
|
`doctor_bitfield` int(10) unsigned NOT NULL,
|
|
`service_bitfield` int(10) unsigned NOT NULL,
|
|
`company_bitfield` int(10) unsigned NOT NULL,
|
|
`hospital_bitfield` int(10) unsigned NOT NULL,
|
|
`room_bitfield` int(10) unsigned NOT NULL,
|
|
`appointment_bitfield` int(10) unsigned NOT NULL,
|
|
`prescription_bitfield` int(10) unsigned DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `r_name_idx` (`name`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `roles`
|
|
--
|
|
|
|
LOCK TABLES `roles` WRITE;
|
|
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
|
|
INSERT INTO `roles` VALUES
|
|
(1,'Admin',7,7,7,7,7,7,7,7,7,7,7,7),
|
|
(2,'Doctor',0,0,0,0,1,1,1,1,1,1,0,7),
|
|
(3,'Patient',0,0,0,0,0,1,1,1,1,1,0,1);
|
|
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `rooms`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `rooms`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `rooms` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`hospital_id` int(10) unsigned NOT NULL,
|
|
`name` varchar(255) NOT NULL,
|
|
`code` varchar(3) NOT NULL,
|
|
`floor` int(10) unsigned NOT NULL,
|
|
`room_number` int(10) unsigned NOT NULL,
|
|
`room_type` enum('General Ward','Private','Intensive Care Unit','Labor and Delivery','Operating','Recovery','Isolation','Emergency','Imaging','Procedure','Physical Therapy','Consultation') NOT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `ch_hospital_id_idx` (`hospital_id`),
|
|
CONSTRAINT `ch_hospital_id` FOREIGN KEY (`hospital_id`) REFERENCES `hospitals` (`id`) ON UPDATE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `rooms`
|
|
--
|
|
|
|
LOCK TABLES `rooms` WRITE;
|
|
/*!40000 ALTER TABLE `rooms` DISABLE KEYS */;
|
|
/*!40000 ALTER TABLE `rooms` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `service_doctors`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `service_doctors`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `service_doctors` (
|
|
`service_id` int(10) unsigned NOT NULL,
|
|
`doctor_id` int(10) unsigned NOT NULL,
|
|
PRIMARY KEY (`service_id`,`doctor_id`),
|
|
KEY `sd_service_id_idx` (`service_id`),
|
|
KEY `sd_doctor_id_idx` (`doctor_id`),
|
|
CONSTRAINT `sd_doctor_id` FOREIGN KEY (`doctor_id`) REFERENCES `doctors` (`id`) ON UPDATE CASCADE,
|
|
CONSTRAINT `sd_service_id` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON UPDATE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `service_doctors`
|
|
--
|
|
|
|
LOCK TABLES `service_doctors` WRITE;
|
|
/*!40000 ALTER TABLE `service_doctors` DISABLE KEYS */;
|
|
INSERT INTO `service_doctors` VALUES
|
|
(8,1),
|
|
(9,1),
|
|
(10,1),
|
|
(11,1),
|
|
(12,1),
|
|
(13,3),
|
|
(14,3);
|
|
/*!40000 ALTER TABLE `service_doctors` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `services`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `services`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `services` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`name` varchar(255) NOT NULL,
|
|
`description` text NOT NULL,
|
|
`price` decimal(10,2) NOT NULL,
|
|
`open_time` time NOT NULL,
|
|
`close_time` time NOT NULL,
|
|
`duration` time NOT NULL,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `services`
|
|
--
|
|
|
|
LOCK TABLES `services` WRITE;
|
|
/*!40000 ALTER TABLE `services` DISABLE KEYS */;
|
|
INSERT INTO `services` VALUES
|
|
(8,'Chirurgie','Service de visio',100.00,'08:00:00','20:00:00','02:00:00'),
|
|
(9,'Mdecine','Service de laboratoire',50.00,'08:00:00','18:30:00','00:30:00'),
|
|
(10,'Cancrologie','Service de cancrologie',75.00,'08:00:00','18:30:00','01:00:00'),
|
|
(11,'Maternit','Service de maternit',150.00,'08:00:00','18:30:00','02:00:00'),
|
|
(12,'Imagerie mdical','Service d\'imagerie',75.00,'08:00:00','18:30:00','01:00:00'),
|
|
(13,'Urgences','Service d\'urgences',25.00,'08:00:00','18:30:00','00:30:00'),
|
|
(14,'TEST','test',100.00,'08:00:00','18:30:00','02:00:00');
|
|
/*!40000 ALTER TABLE `services` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `user_roles`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `user_roles`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `user_roles` (
|
|
`user_id` int(10) unsigned NOT NULL,
|
|
`role_id` int(10) unsigned NOT NULL,
|
|
PRIMARY KEY (`user_id`,`role_id`),
|
|
KEY `ur_user_id_idx` (`user_id`),
|
|
KEY `ur_role_id_idx` (`role_id`),
|
|
CONSTRAINT `ur_role_id` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON UPDATE CASCADE,
|
|
CONSTRAINT `ur_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `user_roles`
|
|
--
|
|
|
|
LOCK TABLES `user_roles` WRITE;
|
|
/*!40000 ALTER TABLE `user_roles` DISABLE KEYS */;
|
|
INSERT INTO `user_roles` VALUES
|
|
(1,3),
|
|
(2,2),
|
|
(3,1),
|
|
(3,2),
|
|
(4,2);
|
|
/*!40000 ALTER TABLE `user_roles` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `users`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `users`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `users` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`first_name` varchar(64) NOT NULL,
|
|
`last_name` varchar(64) NOT NULL,
|
|
`username` varchar(64) NOT NULL,
|
|
`password` varchar(255) NOT NULL,
|
|
`email` varchar(128) NOT NULL,
|
|
`email_verified` tinyint(1) NOT NULL DEFAULT 0,
|
|
`phone` varchar(32) DEFAULT 'None',
|
|
`phone_verified` tinyint(1) NOT NULL DEFAULT 0,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_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
|
|
(1,'test','test','test','$argon2id$v=19$m=65536,t=2,p=1$V9dC6KrvrCE6/iPyBYFX3S2lfpRfkjaYS4GnI0PyQPc$vdLwtm9+pLcP6MdUiUVospAF1x8IfSkhYHFjtrS4SEc','test@gmail.com',0,'0123456789',0),
|
|
(2,'test','test','test2','$argon2id$v=19$m=65536,t=2,p=1$/ZYuaP+6KI0rXxcuGc6005Az84InOV9nEDWs2lpF5qk$mIp/KBTArI1sLCyEeY92zu9TRHrPq/mT8mTFyBYehVo','test2@gmail.com',0,'0123456789',0),
|
|
(3,'admin','admin','admin','$argon2id$v=19$m=65536,t=2,p=1$229wVYU6lNYVcsdxxhJC+FFDTUYquOyc3G6utxRnPhw$p23Uzkt3tXjcLhrkxxSEePl54PY3HeTtQZ0FseCmtQs','admin@gmail.com',0,'0123456789',0),
|
|
(4,'doc','doc','doc1','$argon2id$v=19$m=65536,t=2,p=1$CszRzDJRP/oksX8fyr9oXyqclqf8a+mOiHS0vcImQ+k$Mabh4b3qk9WgGdaotqwuBwOJYuOWEsvsSdgRwy6mHqg','doc@doc.com',0,'0123456789',0);
|
|
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `verification_codes`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `verification_codes`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `verification_codes` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`user_id` int(10) unsigned NOT NULL,
|
|
`verification_code` varchar(255) NOT NULL,
|
|
`type` varchar(32) NOT NULL,
|
|
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
|
|
PRIMARY KEY (`id`),
|
|
KEY `mv_user_id_idx` (`user_id`),
|
|
CONSTRAINT `mv_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `verification_codes`
|
|
--
|
|
|
|
LOCK TABLES `verification_codes` WRITE;
|
|
/*!40000 ALTER TABLE `verification_codes` DISABLE KEYS */;
|
|
/*!40000 ALTER TABLE `verification_codes` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
/*!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 2024-04-25 21:40:49 |