Skip to content

Commit

Permalink
Merge pull request #17 from ctc-uci/ml-nn/5-create-case-management-ta…
Browse files Browse the repository at this point in the history
…bles

Added schemas for case management tables
  • Loading branch information
benson-fm authored Dec 5, 2024
2 parents 81f79fc + 679414d commit 4516811
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server/db/schema/case_managers.sql
Original file line number Diff line number Diff line change
@@ -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
);
10 changes: 10 additions & 0 deletions server/db/schema/locations.sql
Original file line number Diff line number Diff line change
@@ -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)
);
11 changes: 11 additions & 0 deletions server/db/schema/units.sql
Original file line number Diff line number Diff line change
@@ -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)
);

0 comments on commit 4516811

Please sign in to comment.