--
--


SELECT pg_catalog.set_config('search_path', '', false);

--
-- Name: _watiam; Type: SCHEMA; Schema: -; Owner: _dba
--

CREATE SCHEMA _watiam;


ALTER SCHEMA _watiam OWNER TO _dba;

--
-- Name: SCHEMA _watiam; Type: COMMENT; Schema: -; Owner: _dba
--

COMMENT ON SCHEMA _watiam IS 'Data Import: Tables for normal application use of WatIAM data';




--
-- Name: watiam_entry; Type: TABLE; Schema: _watiam; Owner: _watiam_root
--

CREATE TABLE _watiam.watiam_entry (
    pdbid integer NOT NULL,
    surname text NOT NULL,
    givennames text,
    nicknames text,
    email text,
    homepage text,
    visible boolean NOT NULL,
    authority text,
    created date,
    lastmentioned date,
    activated date,
    lastchanged date,
    expires date,
    hr_id integer,
    uw_id integer,
    ts_id integer,
    userid text NOT NULL,
    useridext text NOT NULL,
    ou text[],
    campus_email text,
    CONSTRAINT watiam_entry_check CHECK ((((length(userid) < 8) AND (length(useridext) = 0)) OR (length(userid) = 8)))
);


ALTER TABLE _watiam.watiam_entry OWNER TO _watiam_root;

--
-- Name: TABLE watiam_entry; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON TABLE _watiam.watiam_entry IS 'Information from one line of the WatIAM Extract';


--
-- Name: COLUMN watiam_entry.pdbid; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.pdbid IS 'Persistent DB Identifier';


--
-- Name: COLUMN watiam_entry.surname; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.surname IS 'Surname (example, Smith)';


--
-- Name: COLUMN watiam_entry.givennames; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.givennames IS 'Given names (example, John Edward)';


--
-- Name: COLUMN watiam_entry.nicknames; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.nicknames IS 'Familiar names (example, Ted)';


--
-- Name: COLUMN watiam_entry.email; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.email IS 'Electronic mail (example, jsmith@forestry.uwaterloo.ca)';


--
-- Name: COLUMN watiam_entry.homepage; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.homepage IS 'Personal web page (example, http://forestry.uwaterloo.ca/~jsmith)';


--
-- Name: COLUMN watiam_entry.visible; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.visible IS 'Privacy request, do not publish if FALSE';


--
-- Name: COLUMN watiam_entry.authority; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.authority IS 'Authority who created entry';


--
-- Name: COLUMN watiam_entry.created; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.created IS 'Date entry created';


--
-- Name: COLUMN watiam_entry.lastmentioned; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.lastmentioned IS 'Date last mentioned in authoritative source';


--
-- Name: COLUMN watiam_entry.activated; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.activated IS 'Date authentication token assigned';


--
-- Name: COLUMN watiam_entry.lastchanged; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.lastchanged IS 'Date entry last changed';


--
-- Name: COLUMN watiam_entry.expires; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.expires IS 'Date entry should expire';


--
-- Name: COLUMN watiam_entry.hr_id; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.hr_id IS 'First HR ID number';


--
-- Name: COLUMN watiam_entry.uw_id; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.uw_id IS 'First student ID number';


--
-- Name: COLUMN watiam_entry.ts_id; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.ts_id IS 'First Telephone Services ID number';


--
-- Name: COLUMN watiam_entry.userid; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.userid IS 'Standard UW userid (maximum 8 characters)';


--
-- Name: COLUMN watiam_entry.useridext; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.useridext IS 'Additional UW userid characters; concatenate with userid to get full long userid';


--
-- Name: COLUMN watiam_entry.ou; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON COLUMN _watiam.watiam_entry.ou IS 'Active Directory OU, separated into components';


--
-- Name: watiam_hr_id; Type: TABLE; Schema: _watiam; Owner: _watiam_root
--

CREATE TABLE _watiam.watiam_hr_id (
    pdbid integer NOT NULL,
    hr_id_seq integer NOT NULL,
    hr_id integer NOT NULL
);


ALTER TABLE _watiam.watiam_hr_id OWNER TO _watiam_root;

--
-- Name: watiam_ts_id; Type: TABLE; Schema: _watiam; Owner: _watiam_root
--

CREATE TABLE _watiam.watiam_ts_id (
    pdbid integer NOT NULL,
    ts_id_seq integer NOT NULL,
    ts_id integer NOT NULL
);


ALTER TABLE _watiam.watiam_ts_id OWNER TO _watiam_root;

--
-- Name: watiam_uw_id; Type: TABLE; Schema: _watiam; Owner: _watiam_root
--

CREATE TABLE _watiam.watiam_uw_id (
    pdbid integer NOT NULL,
    uw_id_seq integer NOT NULL,
    uw_id integer NOT NULL
);


ALTER TABLE _watiam.watiam_uw_id OWNER TO _watiam_root;

--
-- Name: check_duplicate_hr_id; Type: VIEW; Schema: _watiam; Owner: _watiam_root
--

CREATE VIEW _watiam.check_duplicate_hr_id AS
 SELECT watiam_hr_id.hr_id,
    array_agg(watiam_hr_id.pdbid) AS pdbids
   FROM _watiam.watiam_hr_id
  GROUP BY watiam_hr_id.hr_id
 HAVING (count(*) > 1)
  ORDER BY watiam_hr_id.hr_id;


ALTER TABLE _watiam.check_duplicate_hr_id OWNER TO _watiam_root;

--
-- Name: VIEW check_duplicate_hr_id; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON VIEW _watiam.check_duplicate_hr_id IS 'HR IDs which occur more than once in the Extract';


--
-- Name: check_duplicate_ts_id; Type: VIEW; Schema: _watiam; Owner: _watiam_root
--

CREATE VIEW _watiam.check_duplicate_ts_id AS
 SELECT watiam_ts_id.ts_id,
    array_agg(watiam_ts_id.pdbid) AS pdbids
   FROM _watiam.watiam_ts_id
  GROUP BY watiam_ts_id.ts_id
 HAVING (count(*) > 1)
  ORDER BY watiam_ts_id.ts_id;


ALTER TABLE _watiam.check_duplicate_ts_id OWNER TO _watiam_root;

--
-- Name: VIEW check_duplicate_ts_id; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON VIEW _watiam.check_duplicate_ts_id IS 'TS IDs which occur more than once in the Extract';


--
-- Name: check_duplicate_uw_id; Type: VIEW; Schema: _watiam; Owner: _watiam_root
--

CREATE VIEW _watiam.check_duplicate_uw_id AS
 SELECT watiam_uw_id.uw_id,
    array_agg(watiam_uw_id.pdbid) AS pdbids
   FROM _watiam.watiam_uw_id
  GROUP BY watiam_uw_id.uw_id
 HAVING (count(*) > 1)
  ORDER BY watiam_uw_id.uw_id;


ALTER TABLE _watiam.check_duplicate_uw_id OWNER TO _watiam_root;

--
-- Name: VIEW check_duplicate_uw_id; Type: COMMENT; Schema: _watiam; Owner: _watiam_root
--

COMMENT ON VIEW _watiam.check_duplicate_uw_id IS 'UW IDs which occur more than once in the Extract';


--
-- Name: watiam_dept_name; Type: TABLE; Schema: _watiam; Owner: _watiam_root
--

CREATE TABLE _watiam.watiam_dept_name (
    pdbid integer NOT NULL,
    dept_name_seq integer NOT NULL,
    dept_name text NOT NULL
);


ALTER TABLE _watiam.watiam_dept_name OWNER TO _watiam_root;

--
-- Name: watiam_dept_num; Type: TABLE; Schema: _watiam; Owner: _watiam_root
--

CREATE TABLE _watiam.watiam_dept_num (
    pdbid integer NOT NULL,
    dept_code_seq integer NOT NULL,
    dept_code text NOT NULL
);


ALTER TABLE _watiam.watiam_dept_num OWNER TO _watiam_root;

--
-- Name: watiam_office; Type: TABLE; Schema: _watiam; Owner: _watiam_root
--

CREATE TABLE _watiam.watiam_office (
    pdbid integer NOT NULL,
    office_seq integer NOT NULL,
    office text NOT NULL
);


ALTER TABLE _watiam.watiam_office OWNER TO _watiam_root;

--
-- Name: watiam_phone; Type: TABLE; Schema: _watiam; Owner: _watiam_root
--

CREATE TABLE _watiam.watiam_phone (
    pdbid integer NOT NULL,
    phone_seq integer NOT NULL,
    phone text NOT NULL
);


ALTER TABLE _watiam.watiam_phone OWNER TO _watiam_root;

--
-- Name: watiam_dept_name_pkey; Type: CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_dept_name
    ADD CONSTRAINT watiam_dept_name_pkey PRIMARY KEY (pdbid, dept_name_seq);


--
-- Name: watiam_dept_num_pkey; Type: CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_dept_num
    ADD CONSTRAINT watiam_dept_num_pkey PRIMARY KEY (pdbid, dept_code_seq);


--
-- Name: watiam_entry_pkey; Type: CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_entry
    ADD CONSTRAINT watiam_entry_pkey PRIMARY KEY (pdbid);


--
-- Name: watiam_entry_userid_key; Type: CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_entry
    ADD CONSTRAINT watiam_entry_userid_key UNIQUE (userid);


--
-- Name: watiam_hr_id_pkey; Type: CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_hr_id
    ADD CONSTRAINT watiam_hr_id_pkey PRIMARY KEY (pdbid, hr_id_seq);


--
-- Name: watiam_office_pkey; Type: CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_office
    ADD CONSTRAINT watiam_office_pkey PRIMARY KEY (pdbid, office_seq);


--
-- Name: watiam_phone_pkey; Type: CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_phone
    ADD CONSTRAINT watiam_phone_pkey PRIMARY KEY (pdbid, phone_seq);


--
-- Name: watiam_ts_id_pkey; Type: CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_ts_id
    ADD CONSTRAINT watiam_ts_id_pkey PRIMARY KEY (pdbid, ts_id_seq);


--
-- Name: watiam_uw_id_pkey; Type: CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_uw_id
    ADD CONSTRAINT watiam_uw_id_pkey PRIMARY KEY (pdbid, uw_id_seq);


--
-- Name: watiam_dept_name_dept_name_idx; Type: INDEX; Schema: _watiam; Owner: _watiam_root
--

CREATE INDEX watiam_dept_name_dept_name_idx ON _watiam.watiam_dept_name USING btree (dept_name);


--
-- Name: watiam_dept_num_dept_code_idx; Type: INDEX; Schema: _watiam; Owner: _watiam_root
--

CREATE INDEX watiam_dept_num_dept_code_idx ON _watiam.watiam_dept_num USING btree (dept_code);


--
-- Name: watiam_entry_lower_idx; Type: INDEX; Schema: _watiam; Owner: _watiam_root
--

CREATE INDEX watiam_entry_lower_idx ON _watiam.watiam_entry USING btree (lower(surname));


--
-- Name: watiam_hr_id_hr_id_idx; Type: INDEX; Schema: _watiam; Owner: _watiam_root
--

CREATE INDEX watiam_hr_id_hr_id_idx ON _watiam.watiam_hr_id USING btree (hr_id);


--
-- Name: watiam_office_office_idx; Type: INDEX; Schema: _watiam; Owner: _watiam_root
--

CREATE INDEX watiam_office_office_idx ON _watiam.watiam_office USING btree (office);


--
-- Name: watiam_phone_phone_idx; Type: INDEX; Schema: _watiam; Owner: _watiam_root
--

CREATE INDEX watiam_phone_phone_idx ON _watiam.watiam_phone USING btree (phone);


--
-- Name: watiam_ts_id_ts_id_idx; Type: INDEX; Schema: _watiam; Owner: _watiam_root
--

CREATE INDEX watiam_ts_id_ts_id_idx ON _watiam.watiam_ts_id USING btree (ts_id);


--
-- Name: watiam_uw_id_uw_id_idx; Type: INDEX; Schema: _watiam; Owner: _watiam_root
--

CREATE INDEX watiam_uw_id_uw_id_idx ON _watiam.watiam_uw_id USING btree (uw_id);


--
-- Name: watiam_dept_name_pdbid_fkey; Type: FK CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_dept_name
    ADD CONSTRAINT watiam_dept_name_pdbid_fkey FOREIGN KEY (pdbid) REFERENCES _watiam.watiam_entry(pdbid);


--
-- Name: watiam_dept_num_pdbid_fkey; Type: FK CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_dept_num
    ADD CONSTRAINT watiam_dept_num_pdbid_fkey FOREIGN KEY (pdbid) REFERENCES _watiam.watiam_entry(pdbid);


--
-- Name: watiam_hr_id_pdbid_fkey; Type: FK CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_hr_id
    ADD CONSTRAINT watiam_hr_id_pdbid_fkey FOREIGN KEY (pdbid) REFERENCES _watiam.watiam_entry(pdbid);


--
-- Name: watiam_office_pdbid_fkey; Type: FK CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_office
    ADD CONSTRAINT watiam_office_pdbid_fkey FOREIGN KEY (pdbid) REFERENCES _watiam.watiam_entry(pdbid);


--
-- Name: watiam_phone_pdbid_fkey; Type: FK CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_phone
    ADD CONSTRAINT watiam_phone_pdbid_fkey FOREIGN KEY (pdbid) REFERENCES _watiam.watiam_entry(pdbid);


--
-- Name: watiam_ts_id_pdbid_fkey; Type: FK CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_ts_id
    ADD CONSTRAINT watiam_ts_id_pdbid_fkey FOREIGN KEY (pdbid) REFERENCES _watiam.watiam_entry(pdbid);


--
-- Name: watiam_uw_id_pdbid_fkey; Type: FK CONSTRAINT; Schema: _watiam; Owner: _watiam_root
--

ALTER TABLE ONLY _watiam.watiam_uw_id
    ADD CONSTRAINT watiam_uw_id_pdbid_fkey FOREIGN KEY (pdbid) REFERENCES _watiam.watiam_entry(pdbid);


--
-- Name: SCHEMA _watiam; Type: ACL; Schema: -; Owner: _dba
--

REVOKE ALL ON SCHEMA _watiam FROM PUBLIC;
REVOKE ALL ON SCHEMA _watiam FROM _dba;
GRANT ALL ON SCHEMA _watiam TO _dba;
GRANT USAGE ON SCHEMA _watiam TO PUBLIC;
GRANT ALL ON SCHEMA _watiam TO _watiam_root;


--
-- Name: TABLE watiam_entry; Type: ACL; Schema: _watiam; Owner: _watiam_root
--

REVOKE ALL ON TABLE _watiam.watiam_entry FROM PUBLIC;
REVOKE ALL ON TABLE _watiam.watiam_entry FROM _watiam_root;
GRANT ALL ON TABLE _watiam.watiam_entry TO _watiam_root;
GRANT INSERT,DELETE,UPDATE ON TABLE _watiam.watiam_entry TO _watiam_load;
GRANT SELECT ON TABLE _watiam.watiam_entry TO _watiam_select;
GRANT REFERENCES ON TABLE _watiam.watiam_entry TO _watiam_references;


--
-- Name: TABLE watiam_hr_id; Type: ACL; Schema: _watiam; Owner: _watiam_root
--

REVOKE ALL ON TABLE _watiam.watiam_hr_id FROM PUBLIC;
REVOKE ALL ON TABLE _watiam.watiam_hr_id FROM _watiam_root;
GRANT ALL ON TABLE _watiam.watiam_hr_id TO _watiam_root;
GRANT INSERT,DELETE,UPDATE ON TABLE _watiam.watiam_hr_id TO _watiam_load;
GRANT SELECT ON TABLE _watiam.watiam_hr_id TO _watiam_select;
GRANT REFERENCES ON TABLE _watiam.watiam_hr_id TO _watiam_references;


--
-- Name: TABLE watiam_ts_id; Type: ACL; Schema: _watiam; Owner: _watiam_root
--

REVOKE ALL ON TABLE _watiam.watiam_ts_id FROM PUBLIC;
REVOKE ALL ON TABLE _watiam.watiam_ts_id FROM _watiam_root;
GRANT ALL ON TABLE _watiam.watiam_ts_id TO _watiam_root;
GRANT INSERT,DELETE,UPDATE ON TABLE _watiam.watiam_ts_id TO _watiam_load;
GRANT SELECT ON TABLE _watiam.watiam_ts_id TO _watiam_select;
GRANT REFERENCES ON TABLE _watiam.watiam_ts_id TO _watiam_references;


--
-- Name: TABLE watiam_uw_id; Type: ACL; Schema: _watiam; Owner: _watiam_root
--

REVOKE ALL ON TABLE _watiam.watiam_uw_id FROM PUBLIC;
REVOKE ALL ON TABLE _watiam.watiam_uw_id FROM _watiam_root;
GRANT ALL ON TABLE _watiam.watiam_uw_id TO _watiam_root;
GRANT INSERT,DELETE,UPDATE ON TABLE _watiam.watiam_uw_id TO _watiam_load;
GRANT SELECT ON TABLE _watiam.watiam_uw_id TO _watiam_select;
GRANT REFERENCES ON TABLE _watiam.watiam_uw_id TO _watiam_references;


--
-- Name: TABLE check_duplicate_hr_id; Type: ACL; Schema: _watiam; Owner: _watiam_root
--

REVOKE ALL ON TABLE _watiam.check_duplicate_hr_id FROM PUBLIC;
REVOKE ALL ON TABLE _watiam.check_duplicate_hr_id FROM _watiam_root;
GRANT ALL ON TABLE _watiam.check_duplicate_hr_id TO _watiam_root;
GRANT INSERT,DELETE,UPDATE ON TABLE _watiam.check_duplicate_hr_id TO _watiam_load;
GRANT SELECT ON TABLE _watiam.check_duplicate_hr_id TO _watiam_select;
GRANT REFERENCES ON TABLE _watiam.check_duplicate_hr_id TO _watiam_references;


--
-- Name: TABLE check_duplicate_ts_id; Type: ACL; Schema: _watiam; Owner: _watiam_root
--

REVOKE ALL ON TABLE _watiam.check_duplicate_ts_id FROM PUBLIC;
REVOKE ALL ON TABLE _watiam.check_duplicate_ts_id FROM _watiam_root;
GRANT ALL ON TABLE _watiam.check_duplicate_ts_id TO _watiam_root;
GRANT INSERT,DELETE,UPDATE ON TABLE _watiam.check_duplicate_ts_id TO _watiam_load;
GRANT SELECT ON TABLE _watiam.check_duplicate_ts_id TO _watiam_select;
GRANT REFERENCES ON TABLE _watiam.check_duplicate_ts_id TO _watiam_references;


--
-- Name: TABLE check_duplicate_uw_id; Type: ACL; Schema: _watiam; Owner: _watiam_root
--

REVOKE ALL ON TABLE _watiam.check_duplicate_uw_id FROM PUBLIC;
REVOKE ALL ON TABLE _watiam.check_duplicate_uw_id FROM _watiam_root;
GRANT ALL ON TABLE _watiam.check_duplicate_uw_id TO _watiam_root;
GRANT INSERT,DELETE,UPDATE ON TABLE _watiam.check_duplicate_uw_id TO _watiam_load;
GRANT SELECT ON TABLE _watiam.check_duplicate_uw_id TO _watiam_select;
GRANT REFERENCES ON TABLE _watiam.check_duplicate_uw_id TO _watiam_references;


--
-- Name: TABLE watiam_dept_name; Type: ACL; Schema: _watiam; Owner: _watiam_root
--

REVOKE ALL ON TABLE _watiam.watiam_dept_name FROM PUBLIC;
REVOKE ALL ON TABLE _watiam.watiam_dept_name FROM _watiam_root;
GRANT ALL ON TABLE _watiam.watiam_dept_name TO _watiam_root;
GRANT INSERT,DELETE,UPDATE ON TABLE _watiam.watiam_dept_name TO _watiam_load;
GRANT SELECT ON TABLE _watiam.watiam_dept_name TO _watiam_select;
GRANT REFERENCES ON TABLE _watiam.watiam_dept_name TO _watiam_references;


--
-- Name: TABLE watiam_dept_num; Type: ACL; Schema: _watiam; Owner: _watiam_root
--

REVOKE ALL ON TABLE _watiam.watiam_dept_num FROM PUBLIC;
REVOKE ALL ON TABLE _watiam.watiam_dept_num FROM _watiam_root;
GRANT ALL ON TABLE _watiam.watiam_dept_num TO _watiam_root;
GRANT INSERT,DELETE,UPDATE ON TABLE _watiam.watiam_dept_num TO _watiam_load;
GRANT SELECT ON TABLE _watiam.watiam_dept_num TO _watiam_select;
GRANT REFERENCES ON TABLE _watiam.watiam_dept_num TO _watiam_references;


--
-- Name: TABLE watiam_office; Type: ACL; Schema: _watiam; Owner: _watiam_root
--

REVOKE ALL ON TABLE _watiam.watiam_office FROM PUBLIC;
REVOKE ALL ON TABLE _watiam.watiam_office FROM _watiam_root;
GRANT ALL ON TABLE _watiam.watiam_office TO _watiam_root;
GRANT INSERT,DELETE,UPDATE ON TABLE _watiam.watiam_office TO _watiam_load;
GRANT SELECT ON TABLE _watiam.watiam_office TO _watiam_select;
GRANT REFERENCES ON TABLE _watiam.watiam_office TO _watiam_references;


--
-- Name: TABLE watiam_phone; Type: ACL; Schema: _watiam; Owner: _watiam_root
--

REVOKE ALL ON TABLE _watiam.watiam_phone FROM PUBLIC;
REVOKE ALL ON TABLE _watiam.watiam_phone FROM _watiam_root;
GRANT ALL ON TABLE _watiam.watiam_phone TO _watiam_root;
GRANT INSERT,DELETE,UPDATE ON TABLE _watiam.watiam_phone TO _watiam_load;
GRANT SELECT ON TABLE _watiam.watiam_phone TO _watiam_select;
GRANT REFERENCES ON TABLE _watiam.watiam_phone TO _watiam_references;


--
--

