-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplanetscale.sql
92 lines (85 loc) · 2.76 KB
/
planetscale.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
-- Path: case-notes-mobile-backend\planetscale-Contacts.sql
CREATE TABLE `Contacts` (
`contactId` int NOT NULL AUTO_INCREMENT,
`createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`modifiedAt` datetime(3) DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
`patientId` int NOT NULL,
`title` varchar(191),
`firstName` varchar(191) NOT NULL,
`middleInitial` varchar(191),
`lastName` varchar(191),
`phone` varchar(191) NOT NULL,
`email` varchar(191) NOT NULL,
`sex` varchar(191),
`dateOfBirth` datetime(3),
`street` varchar(191) NOT NULL,
`city` varchar(191) NOT NULL,
`state` varchar(191) NOT NULL,
`zip` varchar(191) NOT NULL,
`relationToPatient` varchar(191),
`type` varchar(191) NOT NULL,
`emergencyPriority` varchar(191),
`signature` varchar(191),
PRIMARY KEY (`contactId`)
);
-- Path: case-notes-mobile-backend\planetscale-patients.sql
CREATE TABLE `Patients` (
`patientId` int NOT NULL AUTO_INCREMENT,
`createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`modifiedAt` datetime(3) DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
`title` varchar(191),
`firstName` varchar(191) NOT NULL,
`middleInitial` varchar(191),
`lastName` varchar(191) NOT NULL,
`phone` varchar(191) NOT NULL,
`email` varchar(191) NOT NULL,
`sex` varchar(191) NOT NULL,
`ssn` varchar(191) NOT NULL,
`dateOfBirth` datetime(3) NOT NULL,
`street` varchar(191) NOT NULL,
`city` varchar(191) NOT NULL,
`state` varchar(191) NOT NULL,
`zip` varchar(191) NOT NULL,
`insuranceCompany` varchar(191),
`plan` varchar(191),
`groupNumber` varchar(191),
`cardHolder` varchar(191),
`medications` json,
`allergies` json,
`surgeries` json,
`familyHistory` json,
`addictions` json,
`questionnaire` json,
`symptoms` json,
`signature` varchar(191) NOT NULL,
PRIMARY KEY (`patientId`),
UNIQUE KEY `Patients_email_key` (`email`)
);
-- Path: case-notes-mobile-backend\planetscale-appointments.sql
CREATE TABLE `Appointments` (
`appointmentId` int NOT NULL AUTO_INCREMENT,
`appointmentScheduleFrom` datetime NOT NULL,
`appointmentScheduleTo` datetime NOT NULL,
`appointmentType` varchar(45) NOT NULL,
`appointmentStatus` varchar(100) NOT NULL DEFAULT 'free',
`appointmentPatientName` varchar(100),
`appointmentPatientSession` varchar(100),
`doctorId` int NOT NULL,
`PatientId` int NOT NULL,
PRIMARY KEY (`appointmentId`)
);
-- Path: case-notes-mobile-backend\planetscale-schedule.sql
CREATE TABLE `Schedules` (
`scheduleId` int NOT NULL,
`scheduleActivity` varchar(255) NOT NULL,
`roomNumber` int NOT NULL,
`providerGroup` varchar(255) NOT NULL,
`userId` int NOT NULL,
`userName` varchar(255) NOT NULL,
`patientId` int NOT NULL,
`scheduleDate` date,
`scheduleFrom` datetime,
`scheduleTo` datetime,
`scheduleStatus` varchar(255),
PRIMARY KEY (`scheduleId`)
);