X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/1956ab59130096c19a4f041290b1e933258fb025..5310c7000c232cd48f48fe473beeca7f4ff02b53:/db/structure.sql

diff --git a/db/structure.sql b/db/structure.sql
index 742791df5..14e6592fc 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -726,9 +726,9 @@ CREATE TABLE issues (
     id integer NOT NULL,
     reportable_type character varying NOT NULL,
     reportable_id integer NOT NULL,
-    reported_user_id integer NOT NULL,
+    reported_user_id integer,
     status integer,
-    issue_type character varying,
+    assigned_role user_role_enum NOT NULL,
     resolved_at timestamp without time zone,
     resolved_by integer,
     updated_by integer,
@@ -1064,9 +1064,10 @@ CREATE TABLE relations (
 
 CREATE TABLE reports (
     id integer NOT NULL,
-    issue_id integer,
-    user_id integer,
+    issue_id integer NOT NULL,
+    user_id integer NOT NULL,
     details text NOT NULL,
+    category character varying NOT NULL,
     created_at timestamp without time zone NOT NULL,
     updated_at timestamp without time zone NOT NULL
 );
@@ -2045,10 +2046,10 @@ CREATE INDEX index_issue_comments_on_user_id ON issue_comments USING btree (user
 
 
 --
--- Name: index_issues_on_reportable_id_and_reportable_type; Type: INDEX; Schema: public; Owner: -
+-- Name: index_issues_on_reportable_type_and_reportable_id; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_issues_on_reportable_id_and_reportable_type ON issues USING btree (reportable_id, reportable_type);
+CREATE INDEX index_issues_on_reportable_type_and_reportable_id ON issues USING btree (reportable_type, reportable_id);
 
 
 --
@@ -2531,15 +2532,15 @@ ALTER TABLE ONLY gpx_files
 --
 
 ALTER TABLE ONLY issue_comments
-    ADD CONSTRAINT issue_comments_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+    ADD CONSTRAINT issue_comments_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id);
 
 
 --
--- Name: issue_comments_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
+-- Name: issue_comments_user_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) ON DELETE CASCADE;
+    ADD CONSTRAINT issue_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
 
 
 --
@@ -2547,7 +2548,15 @@ ALTER TABLE ONLY issue_comments
 --
 
 ALTER TABLE ONLY issues
-    ADD CONSTRAINT issues_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES users(id) ON DELETE CASCADE;
+    ADD CONSTRAINT issues_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES users(id);
+
+
+--
+-- Name: issues_resolved_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY issues
+    ADD CONSTRAINT issues_resolved_by_fkey FOREIGN KEY (resolved_by) REFERENCES users(id);
 
 
 --
@@ -2555,7 +2564,7 @@ ALTER TABLE ONLY issues
 --
 
 ALTER TABLE ONLY issues
-    ADD CONSTRAINT issues_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES users(id) ON DELETE CASCADE;
+    ADD CONSTRAINT issues_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES users(id);
 
 
 --
@@ -2675,7 +2684,7 @@ ALTER TABLE ONLY relations
 --
 
 ALTER TABLE ONLY reports
-    ADD CONSTRAINT reports_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+    ADD CONSTRAINT reports_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id);
 
 
 --
@@ -2683,7 +2692,7 @@ ALTER TABLE ONLY reports
 --
 
 ALTER TABLE ONLY reports
-    ADD CONSTRAINT reports_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+    ADD CONSTRAINT reports_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
 
 
 --
@@ -2877,3 +2886,5 @@ INSERT INTO "schema_migrations" (version) VALUES
 ('7'),
 ('8'),
 ('9');
+
+
