generated from ctc-uci/npo-template-merged
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from ctc-uci/ml-nn/5-create-case-management-ta…
…bles Added schemas for case management tables
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
); |