· 8 years ago · Mar 10, 2018, 06:20 PM
1-- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64)
2--
3-- Host: 127.0.0.1 Database: medical
4-- ------------------------------------------------------
5-- Server version 5.7.19
6
7/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10/*!40101 SET NAMES utf8 */;
11/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12/*!40103 SET TIME_ZONE='+00:00' */;
13/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17
18--
19-- Table structure for table `doctor`
20--
21
22DROP TABLE IF EXISTS `doctor`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!40101 SET character_set_client = utf8 */;
25CREATE TABLE `doctor` (
26 `id` int(11) NOT NULL AUTO_INCREMENT,
27 `ssn` varchar(45) NOT NULL,
28 `first_name` varchar(45) NOT NULL,
29 `last_name` varchar(45) NOT NULL,
30 `specification` varchar(45) NOT NULL,
31 `gender` tinyint(1) NOT NULL,
32 `phone` varchar(45) NOT NULL,
33 `email` varchar(45) NOT NULL,
34 `password` varchar(100) NOT NULL,
35 `experience` varchar(45) NOT NULL,
36 `created_at` datetime NOT NULL,
37 `updated_at` datetime NOT NULL,
38 `birthdate` date NOT NULL,
39 PRIMARY KEY (`id`)
40) ENGINE=InnoDB DEFAULT CHARSET=utf8;
41/*!40101 SET character_set_client = @saved_cs_client */;
42
43--
44-- Table structure for table `doctor_sanctuary`
45--
46
47DROP TABLE IF EXISTS `doctor_sanctuary`;
48/*!40101 SET @saved_cs_client = @@character_set_client */;
49/*!40101 SET character_set_client = utf8 */;
50CREATE TABLE `doctor_sanctuary` (
51 `doctor_id` int(11) NOT NULL,
52 `sanctuary_id` int(11) NOT NULL,
53 `created_at` datetime NOT NULL,
54 `updatyed_at` datetime NOT NULL,
55 PRIMARY KEY (`sanctuary_id`,`doctor_id`)
56) ENGINE=InnoDB DEFAULT CHARSET=utf8;
57/*!40101 SET character_set_client = @saved_cs_client */;
58
59--
60-- Table structure for table `medicine`
61--
62
63DROP TABLE IF EXISTS `medicine`;
64/*!40101 SET @saved_cs_client = @@character_set_client */;
65/*!40101 SET character_set_client = utf8 */;
66CREATE TABLE `medicine` (
67 `id` int(11) NOT NULL AUTO_INCREMENT,
68 `name` varchar(45) NOT NULL,
69 `time` datetime NOT NULL,
70 `from` date NOT NULL,
71 `to` date NOT NULL,
72 PRIMARY KEY (`id`),
73 UNIQUE KEY `name_UNIQUE` (`name`)
74) ENGINE=InnoDB DEFAULT CHARSET=utf8;
75/*!40101 SET character_set_client = @saved_cs_client */;
76
77--
78-- Table structure for table `migrations`
79--
80
81DROP TABLE IF EXISTS `migrations`;
82/*!40101 SET @saved_cs_client = @@character_set_client */;
83/*!40101 SET character_set_client = utf8 */;
84CREATE TABLE `migrations` (
85 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
86 `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
87 `batch` int(11) NOT NULL,
88 PRIMARY KEY (`id`)
89) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
90/*!40101 SET character_set_client = @saved_cs_client */;
91
92--
93-- Table structure for table `patient`
94--
95
96DROP TABLE IF EXISTS `patient`;
97/*!40101 SET @saved_cs_client = @@character_set_client */;
98/*!40101 SET character_set_client = utf8 */;
99CREATE TABLE `patient` (
100 `id` int(11) NOT NULL AUTO_INCREMENT,
101 `first_name` varchar(45) NOT NULL,
102 `last_name` varchar(45) NOT NULL,
103 `ssn` varchar(45) NOT NULL,
104 `gender` tinyint(1) NOT NULL,
105 `password` varchar(100) NOT NULL,
106 `medical_history` text,
107 `priority` tinyint(1) NOT NULL,
108 `birthdate` date NOT NULL,
109 `created_at` datetime DEFAULT NULL,
110 `updated_at` datetime DEFAULT NULL,
111 `phone` varchar(45) NOT NULL,
112 `sanctuary_id` varchar(45) NOT NULL,
113 PRIMARY KEY (`id`)
114) ENGINE=InnoDB DEFAULT CHARSET=utf8;
115/*!40101 SET character_set_client = @saved_cs_client */;
116
117--
118-- Table structure for table `patient_doctor`
119--
120
121DROP TABLE IF EXISTS `patient_doctor`;
122/*!40101 SET @saved_cs_client = @@character_set_client */;
123/*!40101 SET character_set_client = utf8 */;
124CREATE TABLE `patient_doctor` (
125 `patient_id` int(11) NOT NULL,
126 `doctor_id` int(11) NOT NULL,
127 `comments` varchar(45) NOT NULL,
128 `created_at` datetime NOT NULL,
129 `updated_at` datetime NOT NULL,
130 PRIMARY KEY (`doctor_id`,`patient_id`)
131) ENGINE=InnoDB DEFAULT CHARSET=utf8;
132/*!40101 SET character_set_client = @saved_cs_client */;
133
134--
135-- Table structure for table `patient_medicines`
136--
137
138DROP TABLE IF EXISTS `patient_medicines`;
139/*!40101 SET @saved_cs_client = @@character_set_client */;
140/*!40101 SET character_set_client = utf8 */;
141CREATE TABLE `patient_medicines` (
142 `patient_id` int(11) NOT NULL,
143 `medicine_id` int(11) NOT NULL,
144 `created_at` datetime NOT NULL,
145 `updated_at` datetime NOT NULL,
146 PRIMARY KEY (`patient_id`,`medicine_id`)
147) ENGINE=InnoDB DEFAULT CHARSET=utf8;
148/*!40101 SET character_set_client = @saved_cs_client */;
149
150--
151-- Table structure for table `patient_readings`
152--
153
154DROP TABLE IF EXISTS `patient_readings`;
155/*!40101 SET @saved_cs_client = @@character_set_client */;
156/*!40101 SET character_set_client = utf8 */;
157CREATE TABLE `patient_readings` (
158 `patient_id` int(11) NOT NULL,
159 `sensor_id` int(11) NOT NULL,
160 `readings` varchar(45) NOT NULL,
161 `created_at` datetime DEFAULT NULL,
162 `updated_at` datetime DEFAULT NULL,
163 PRIMARY KEY (`patient_id`)
164) ENGINE=InnoDB DEFAULT CHARSET=utf8;
165/*!40101 SET character_set_client = @saved_cs_client */;
166
167--
168-- Table structure for table `sanctuary`
169--
170
171DROP TABLE IF EXISTS `sanctuary`;
172/*!40101 SET @saved_cs_client = @@character_set_client */;
173/*!40101 SET character_set_client = utf8 */;
174CREATE TABLE `sanctuary` (
175 `id` int(11) NOT NULL AUTO_INCREMENT,
176 `name` varchar(45) NOT NULL,
177 `location` varchar(45) NOT NULL,
178 `description` varchar(255) NOT NULL,
179 `created_at` datetime DEFAULT NULL,
180 `updated_at` datetime DEFAULT NULL,
181 PRIMARY KEY (`id`)
182) ENGINE=InnoDB DEFAULT CHARSET=utf8;
183/*!40101 SET character_set_client = @saved_cs_client */;
184
185--
186-- Table structure for table `sensors`
187--
188
189DROP TABLE IF EXISTS `sensors`;
190/*!40101 SET @saved_cs_client = @@character_set_client */;
191/*!40101 SET character_set_client = utf8 */;
192CREATE TABLE `sensors` (
193 `id` int(11) NOT NULL AUTO_INCREMENT,
194 `patient_id` int(11) NOT NULL,
195 `last_updated_time` varchar(45) NOT NULL,
196 `kind` varchar(45) NOT NULL,
197 `duration_of_stability` double NOT NULL,
198 `results` varchar(45) NOT NULL,
199 `created_at` datetime DEFAULT NULL,
200 `updated_at` varchar(45) DEFAULT NULL,
201 PRIMARY KEY (`id`)
202) ENGINE=InnoDB DEFAULT CHARSET=utf8;
203/*!40101 SET character_set_client = @saved_cs_client */;
204/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
205
206/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
207/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
208/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
209/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
210/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
211/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
212/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
213
214-- Dump completed on 2018-03-10 19:54:24