This repository has been archived by the owner on May 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
build_schema.aql
71 lines (62 loc) · 1.87 KB
/
build_schema.aql
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
---------------------------------------------------------------
-- Database schema used when benchmarking AQL. Based on the
-- schema used for cassandra, see build_schema.cql.
--
-- AQL is an SQL-like interface for the AntidoteDB data store.
-- For more information and documentation see AQL's repository:
-- https://github.com/mrshankly/secure-aql
---------------------------------------------------------------
CREATE UPDATE-WINS TABLE FmkePatients (
ID int PRIMARY KEY,
Name varchar,
Address varchar
);
CREATE UPDATE-WINS TABLE FmkePharmacies (
ID int PRIMARY KEY,
Name varchar,
Address varchar
);
CREATE UPDATE-WINS TABLE FmkeMedicalStaff (
ID int PRIMARY KEY,
Name varchar,
Address varchar,
Speciality varchar
);
CREATE UPDATE-WINS TABLE FmkeTreatmentFacilities (
ID int PRIMARY KEY,
Name varchar,
Address varchar,
Type varchar
);
CREATE UPDATE-WINS TABLE FmkePrescriptions (
ID int PRIMARY KEY,
PatID int,
DocID int,
PharmID int,
DatePrescribed varchar,
DateProcessed varchar
);
CREATE UPDATE-WINS TABLE FmkePatientPrescriptions (
ID int PRIMARY KEY,
PatientID int,
PrescriptionID int
);
CREATE INDEX FmkePatientPrescriptionsPatientIdx ON FmkePatientPrescriptions (PatientID);
CREATE UPDATE-WINS TABLE FmkePharmacyPrescriptions (
ID int PRIMARY KEY,
PharmacyID int,
PrescriptionID int
);
CREATE INDEX FmkePharmacyPrescriptionsPharmacyIdx ON FmkePharmacyPrescriptions (PharmacyID);
CREATE UPDATE-WINS TABLE FmkeStaffPrescriptions (
ID int PRIMARY KEY,
StaffID int,
PrescriptionID int
);
CREATE INDEX FmkeStaffPrescriptionsStaffIdx ON FmkeStaffPrescriptions (StaffID);
CREATE UPDATE-WINS TABLE FmkePrescriptionDrugs (
ID int PRIMARY KEY,
PrescriptionID int,
Drug varchar
);
CREATE INDEX FmkePrescriptionDrugsPrescriptionIdx ON FmkePrescriptionDrugs (PrescriptionID);