AS '$libdir/libpgosm', 'xid_to_int4';
+SET default_tablespace = '';
+
+SET default_with_oids = false;
+
SET default_tablespace = '';
SET default_with_oids = false;
CREATE TABLE issue_comments (
id integer NOT NULL,
issue_id integer,
- user_id integer,
+ commenter_user_id integer,
body text,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
CREATE TABLE issues (
id integer NOT NULL,
- reportable_type character varying,
- reportable_id integer,
- user_id integer,
+ reportable_type character varying NOT NULL,
+ reportable_id integer NOT NULL,
+ reported_user_id integer NOT NULL,
status integer,
resolved_at timestamp without time zone,
resolved_by integer,
CREATE TABLE reports (
id integer NOT NULL,
issue_id integer,
- user_id integer,
+ reporter_user_id integer,
details text,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
--
--- Name: index_issue_comments_on_issue_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+-- Name: index_issue_comments_on_commenter_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
-CREATE INDEX index_issue_comments_on_issue_id ON issue_comments USING btree (issue_id);
+CREATE INDEX index_issue_comments_on_commenter_user_id ON issue_comments USING btree (commenter_user_id);
--
--- Name: index_issue_comments_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+-- Name: index_issue_comments_on_issue_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
-CREATE INDEX index_issue_comments_on_user_id ON issue_comments USING btree (user_id);
+CREATE INDEX index_issue_comments_on_issue_id ON issue_comments USING btree (issue_id);
--
--
--- Name: index_issues_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+-- Name: index_issues_on_reported_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
-CREATE INDEX index_issues_on_user_id ON issues USING btree (user_id);
+CREATE INDEX index_issues_on_reported_user_id ON issues USING btree (reported_user_id);
--
--
--- Name: index_reports_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+-- Name: index_reports_on_reporter_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
-CREATE INDEX index_reports_on_user_id ON reports USING btree (user_id);
+CREATE INDEX index_reports_on_reporter_user_id ON reports USING btree (reporter_user_id);
--
--
--- Name: issue_comments_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+-- Name: issue_comments_commenter_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY issue_comments
- ADD CONSTRAINT issue_comments_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id);
+ ADD CONSTRAINT issue_comments_commenter_user_id FOREIGN KEY (commenter_user_id) REFERENCES users(id);
--
--- Name: issue_comments_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
+-- Name: issue_comments_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY issue_comments
- ADD CONSTRAINT issue_comments_user_id FOREIGN KEY (user_id) REFERENCES users(id);
+ ADD CONSTRAINT issue_comments_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id);
--
--- Name: issues_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+-- Name: issues_reported_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY issues
- ADD CONSTRAINT issues_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
+ ADD CONSTRAINT issues_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES users(id);
--
--
--- Name: reports_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+-- Name: reports_reporter_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY reports
- ADD CONSTRAINT reports_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
+ ADD CONSTRAINT reports_reporter_user_id_fkey FOREIGN KEY (reporter_user_id) REFERENCES users(id);
--
INSERT INTO schema_migrations (version) VALUES ('20150516073616');
-INSERT INTO schema_migrations (version) VALUES ('20150516075620');
-
INSERT INTO schema_migrations (version) VALUES ('20150526130032');
-INSERT INTO schema_migrations (version) VALUES ('20150528113100');
-
-INSERT INTO schema_migrations (version) VALUES ('20150528114520');
-
INSERT INTO schema_migrations (version) VALUES ('21');
INSERT INTO schema_migrations (version) VALUES ('22');