diff --git a/server/db/schema/case_managers.sql b/server/db/schema/case_managers.sql new file mode 100644 index 0000000..1e588c8 --- /dev/null +++ b/server/db/schema/case_managers.sql @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS case_managers; + +CREATE TYPE role AS ENUM ('superadmin', 'admin', 'case manager', 'intern'); + +CREATE TABLE case_managers( + id VARCHAR(256) NOT NULL PRIMARY KEY, + role role NOT NULL, + first_name VARCHAR(16) NOT NULL, + last_name VARCHAR(16) NOT NULL, + phone_number VARCHAR(10) NOT NULL, + email VARCHAR(32) NOT NULL +); diff --git a/server/db/schema/locations.sql b/server/db/schema/locations.sql new file mode 100644 index 0000000..97fca24 --- /dev/null +++ b/server/db/schema/locations.sql @@ -0,0 +1,10 @@ +DROP TABLE IF EXISTS locations; + +CREATE TABLE locations( + id INT NOT NULL PRIMARY KEY, + cm_id VARCHAR(256) NOT NULL, + name VARCHAR(64) NOT NULL, + date date NOT NULL, + caloptima_funded BOOLEAN NOT NULL, + FOREIGN KEY (cm_id) REFERENCES case_managers(id) +); diff --git a/server/db/schema/units.sql b/server/db/schema/units.sql new file mode 100644 index 0000000..74c1501 --- /dev/null +++ b/server/db/schema/units.sql @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS units; + +CREATE TYPE type AS ENUM ('family', 'single'); + +CREATE TABLE units( + id INT NOT NULL PRIMARY KEY, + location_id INT NOT NULL, + name VARCHAR(64) NOT NULL, + type type NOT NULL, + FOREIGN KEY (location_id) REFERENCES locations(id) +);