X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c7bc13668b78afde72e9b8f6644b001799e84eb9..81b6599830e04cc45d7b847b7626015b76febf9f:/db/structure.sql?ds=inline

diff --git a/db/structure.sql b/db/structure.sql
index e19788329..3ee7b9ac6 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -151,10 +151,6 @@ CREATE FUNCTION xid_to_int4(xid) RETURNS integer
     AS '$libdir/libpgosm', 'xid_to_int4';
 
 
-SET default_tablespace = '';
-
-SET default_with_oids = false;
-
 SET default_tablespace = '';
 
 SET default_with_oids = false;
@@ -677,6 +673,7 @@ CREATE TABLE issue_comments (
     commenter_user_id integer,
     body text,
     created_at timestamp without time zone NOT NULL,
+    reassign boolean,
     updated_at timestamp without time zone NOT NULL
 );
 
@@ -710,10 +707,13 @@ 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,
+    report_count integer DEFAULT 0
 );
 
 
@@ -2007,6 +2007,13 @@ CREATE INDEX index_issues_on_reportable_id_and_reportable_type ON issues USING b
 CREATE INDEX index_issues_on_reported_user_id ON issues USING btree (reported_user_id);
 
 
+--
+-- Name: index_issues_on_updated_by; Type: INDEX; Schema: public; Owner: -; Tablespace: 
+--
+
+CREATE INDEX index_issues_on_updated_by ON issues USING btree (updated_by);
+
+
 --
 -- Name: index_note_comments_on_body; Type: INDEX; Schema: public; Owner: -
 --
@@ -2450,7 +2457,7 @@ ALTER TABLE ONLY gpx_files
 --
 
 ALTER TABLE ONLY issue_comments
-    ADD CONSTRAINT issue_comments_commenter_user_id FOREIGN KEY (commenter_user_id) REFERENCES users(id);
+    ADD CONSTRAINT issue_comments_commenter_user_id FOREIGN KEY (commenter_user_id) REFERENCES users(id) ON DELETE CASCADE;
 
 
 --
@@ -2458,7 +2465,7 @@ ALTER TABLE ONLY issue_comments
 --
 
 ALTER TABLE ONLY issue_comments
-    ADD CONSTRAINT issue_comments_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id);
+    ADD CONSTRAINT issue_comments_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
 
 
 --
@@ -2466,7 +2473,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);
+    ADD CONSTRAINT issues_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES users(id) ON DELETE CASCADE;
+
+
+--
+-- Name: issues_updated_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY issues
+    ADD CONSTRAINT issues_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES users(id) ON DELETE CASCADE;
 
 
 --
@@ -2586,7 +2601,7 @@ 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;
 
 
 --
@@ -2594,7 +2609,7 @@ ALTER TABLE ONLY reports
 --
 
 ALTER TABLE ONLY reports
-    ADD CONSTRAINT reports_reporter_user_id_fkey FOREIGN KEY (reporter_user_id) REFERENCES users(id);
+    ADD CONSTRAINT reports_reporter_user_id_fkey FOREIGN KEY (reporter_user_id) REFERENCES users(id) ON DELETE CASCADE;
 
 
 --
@@ -2791,6 +2806,8 @@ INSERT INTO schema_migrations (version) VALUES ('20150516073616');
 
 INSERT INTO schema_migrations (version) VALUES ('20150526130032');
 
+INSERT INTO schema_migrations (version) VALUES ('20150719160821');
+
 INSERT INTO schema_migrations (version) VALUES ('21');
 
 INSERT INTO schema_migrations (version) VALUES ('22');
