]> git.openstreetmap.org Git - rails.git/blobdiff - db/structure.sql
Added support for reporting Changesets + Deleting issues from the CLI
[rails.git] / db / structure.sql
index efabdbee696899a7057a785dd424b291eb40e711..5919574f45f9ba170583149b57882e547265eda9 100644 (file)
@@ -670,9 +670,10 @@ ALTER SEQUENCE gpx_files_id_seq OWNED BY gpx_files.id;
 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,
+    reassign boolean,
     updated_at timestamp without time zone NOT NULL
 );
 
@@ -706,10 +707,12 @@ CREATE TABLE issues (
     reportable_id integer NOT NULL,
     reported_user_id integer NOT NULL,
     status integer,
+    issue_type character varying,
     resolved_at timestamp without time zone,
     resolved_by integer,
     created_at timestamp without time zone NOT NULL,
-    updated_at timestamp without time zone NOT NULL
+    updated_at timestamp without time zone NOT NULL,
+    updated_by integer
 );
 
 
@@ -1040,7 +1043,7 @@ CREATE TABLE relations (
 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
@@ -1975,6 +1978,13 @@ CREATE UNIQUE INDEX index_changesets_subscribers_on_subscriber_id_and_changeset_
 CREATE UNIQUE INDEX index_client_applications_on_key ON client_applications USING btree (key);
 
 
+--
+-- Name: index_issue_comments_on_commenter_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
+--
+
+CREATE INDEX index_issue_comments_on_commenter_user_id ON issue_comments USING btree (commenter_user_id);
+
+
 --
 -- Name: index_issue_comments_on_issue_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
 --
@@ -1983,10 +1993,17 @@ CREATE INDEX index_issue_comments_on_issue_id ON issue_comments USING btree (iss
 
 
 --
--- Name: index_issue_comments_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
+-- Name: index_issues_on_reportable_id_and_reportable_type; Type: INDEX; Schema: public; Owner: -; Tablespace: 
+--
+
+CREATE INDEX index_issues_on_reportable_id_and_reportable_type ON issues USING btree (reportable_id, reportable_type);
+
+
+--
+-- Name: index_issues_on_reported_user_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_issues_on_reported_user_id ON issues USING btree (reported_user_id);
 
 
 --
@@ -2025,10 +2042,10 @@ CREATE INDEX index_reports_on_issue_id ON reports USING btree (issue_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);
 
 
 --
@@ -2136,20 +2153,6 @@ CREATE INDEX relations_changeset_id_idx ON relations USING btree (changeset_id);
 CREATE INDEX relations_timestamp_idx ON relations USING btree ("timestamp");
 
 
---
--- Name: reportable_object_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE INDEX reportable_object_idx ON issues USING btree (reportable_id, reportable_type);
-
-
---
--- Name: reported_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE INDEX reported_user_id_idx ON issues USING btree (reported_user_id);
-
-
 --
 -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -
 --
@@ -2442,19 +2445,19 @@ ALTER TABLE ONLY gpx_files
 
 
 --
--- 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) ON DELETE CASCADE;
 
 
 --
--- 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) ON DELETE CASCADE;
 
 
 --
@@ -2462,7 +2465,7 @@ ALTER TABLE ONLY issue_comments
 --
 
 ALTER TABLE ONLY issues
-    ADD CONSTRAINT issues_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES users(id);
+    ADD CONSTRAINT issues_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES users(id) ON DELETE CASCADE;
 
 
 --
@@ -2582,15 +2585,15 @@ ALTER TABLE ONLY relations
 --
 
 ALTER TABLE ONLY reports
-    ADD CONSTRAINT reports_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id);
+    ADD CONSTRAINT reports_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
 
 
 --
--- 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) ON DELETE CASCADE;
 
 
 --
@@ -2785,8 +2788,6 @@ INSERT INTO schema_migrations (version) VALUES ('20150222101847');
 
 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 ('21');