X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/bdc6adddbfdcc57bd300688f48b28e027e561728..d1d4f8192da5a266cddb17bb8970b2b04387888c:/db/structure.sql

diff --git a/db/structure.sql b/db/structure.sql
index f0a07adf5..efabdbee6 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -702,9 +702,9 @@ ALTER SEQUENCE issue_comments_id_seq OWNED BY issue_comments.id;
 
 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,
@@ -1989,20 +1989,6 @@ CREATE INDEX index_issue_comments_on_issue_id ON issue_comments USING btree (iss
 CREATE INDEX index_issue_comments_on_user_id ON issue_comments USING btree (user_id);
 
 
---
--- 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_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE INDEX index_issues_on_user_id ON issues USING btree (user_id);
-
-
 --
 -- Name: index_note_comments_on_body; Type: INDEX; Schema: public; Owner: -
 --
@@ -2150,6 +2136,20 @@ 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: -
 --
@@ -2458,11 +2458,11 @@ ALTER TABLE ONLY issue_comments
 
 
 --
--- 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);
 
 
 --
@@ -2789,10 +2789,6 @@ 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');
