Skip to content
This repository has been archived by the owner on Jul 5, 2018. It is now read-only.

Commit

Permalink
Remove studentxmessage SQL table & add indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisjacquet committed Feb 24, 2016
1 parent 5918f68 commit e0e3d05
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
15 changes: 9 additions & 6 deletions Messaging/delete.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,30 @@ DELETE FROM profile_exceptions WHERE modname='Messaging/Write.php';
* Student cross message table
*/
--
-- Name: studentxmessage; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
--

DROP TABLE studentxmessage;


/**
* User cross message table
*/
--
-- Name: userxmessage; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
--
DROP INDEX userxmessage_ind;

DROP TABLE userxmessage;


/**
* Messages table
*/
DROP INDEX messages_ind;

ALTER TABLE ONLY messages DROP CONSTRAINT messages_pkey;

DROP SEQUENCE messages_seq;


--
-- Name: messages; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
--

DROP TABLE messages;

29 changes: 13 additions & 16 deletions Messaging/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,27 @@ INSERT INTO profile_exceptions (profile_id, modname, can_use, can_edit) VALUES (
*/

/**
* Student cross message table
* User cross message table
*/
--
-- Name: studentxmessage; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
-- Name: userxmessage; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
--

CREATE TABLE studentxmessage (
student_id numeric NOT NULL,
CREATE TABLE userxmessage (
user_id numeric NOT NULL,
key character varying(10),
message_id numeric NOT NULL,
status character varying(10)
status character varying(10) NOT NULL
);


/**
* User cross message table
*/

--
-- Name: userxmessage; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
-- Name: userxmessage_ind; Type: INDEX; Schema: public; Owner: rosariosis; Tablespace:
--

CREATE TABLE userxmessage (
user_id numeric NOT NULL,
message_id numeric NOT NULL,
status character varying(10)
);
CREATE INDEX userxmessage_ind ON userxmessage USING btree (user_id, key, status);



/**
Expand All @@ -87,6 +83,7 @@ CREATE TABLE messages (
message_id numeric NOT NULL,
syear numeric(4,0),
school_id numeric NOT NULL,
"from" character varying(255),
recipients text,
subject character varying(100),
"datetime" timestamp(0) without time zone,
Expand Down Expand Up @@ -124,7 +121,7 @@ ALTER TABLE ONLY messages


--
-- Name: attendance_code_categories_ind2; Type: INDEX; Schema: public; Owner: rosariosis; Tablespace:
-- Name: messages_ind; Type: INDEX; Schema: public; Owner: rosariosis; Tablespace:
--

CREATE INDEX messages_ind ON message USING btree (syear, school_id);
CREATE INDEX messages_ind ON messages USING btree (syear, school_id);

0 comments on commit e0e3d05

Please sign in to comment.