]> git.openstreetmap.org Git - rails.git/blobdiff - db/structure.sql
Revert unrelated changes from db/structure.sql
[rails.git] / db / structure.sql
index 5919574f45f9ba170583149b57882e547265eda9..53be24a5a8b20ddc2aa81d81cb567b0d9615379c 100644 (file)
@@ -664,7 +664,7 @@ ALTER SEQUENCE gpx_files_id_seq OWNED BY gpx_files.id;
 
 
 --
--- Name: issue_comments; Type: TABLE; Schema: public; Owner: -; Tablespace: 
+-- Name: issue_comments; Type: TABLE; Schema: public; Owner: -
 --
 
 CREATE TABLE issue_comments (
@@ -698,7 +698,7 @@ ALTER SEQUENCE issue_comments_id_seq OWNED BY issue_comments.id;
 
 
 --
--- Name: issues; Type: TABLE; Schema: public; Owner: -; Tablespace: 
+-- Name: issues; Type: TABLE; Schema: public; Owner: -
 --
 
 CREATE TABLE issues (
@@ -712,7 +712,8 @@ CREATE TABLE issues (
     resolved_by integer,
     created_at timestamp without time zone NOT NULL,
     updated_at timestamp without time zone NOT NULL,
-    updated_by integer
+    updated_by integer,
+    report_count integer DEFAULT 0
 );
 
 
@@ -1037,7 +1038,7 @@ CREATE TABLE relations (
 
 
 --
--- Name: reports; Type: TABLE; Schema: public; Owner: -; Tablespace: 
+-- Name: reports; Type: TABLE; Schema: public; Owner: -
 --
 
 CREATE TABLE reports (
@@ -1599,7 +1600,7 @@ ALTER TABLE ONLY gpx_files
 
 
 --
--- Name: issue_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
+-- Name: issue_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
 --
 
 ALTER TABLE ONLY issue_comments
@@ -1607,7 +1608,7 @@ ALTER TABLE ONLY issue_comments
 
 
 --
--- Name: issues_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
+-- Name: issues_pkey; Type: CONSTRAINT; Schema: public; Owner: -
 --
 
 ALTER TABLE ONLY issues
@@ -1711,7 +1712,7 @@ ALTER TABLE ONLY relations
 
 
 --
--- Name: reports_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
+-- Name: reports_pkey; Type: CONSTRAINT; Schema: public; Owner: -
 --
 
 ALTER TABLE ONLY reports
@@ -1979,33 +1980,40 @@ CREATE UNIQUE INDEX index_client_applications_on_key ON client_applications USIN
 
 
 --
--- Name: index_issue_comments_on_commenter_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
+-- Name: index_issue_comments_on_commenter_user_id; Type: INDEX; Schema: public; Owner: -
 --
 
 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: 
+-- Name: index_issue_comments_on_issue_id; Type: INDEX; Schema: public; Owner: -
 --
 
 CREATE INDEX index_issue_comments_on_issue_id ON issue_comments USING btree (issue_id);
 
 
 --
--- Name: index_issues_on_reportable_id_and_reportable_type; Type: INDEX; Schema: public; Owner: -; Tablespace: 
+-- Name: index_issues_on_reportable_id_and_reportable_type; Type: INDEX; Schema: public; Owner: -
 --
 
 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: 
+-- Name: index_issues_on_reported_user_id; Type: INDEX; Schema: public; Owner: -
 --
 
 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: -
+--
+
+CREATE INDEX index_issues_on_updated_by ON issues USING btree (updated_by);
+
+
 --
 -- Name: index_note_comments_on_body; Type: INDEX; Schema: public; Owner: -
 --
@@ -2035,14 +2043,14 @@ CREATE UNIQUE INDEX index_oauth_tokens_on_token ON oauth_tokens USING btree (tok
 
 
 --
--- Name: index_reports_on_issue_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
+-- Name: index_reports_on_issue_id; Type: INDEX; Schema: public; Owner: -
 --
 
 CREATE INDEX index_reports_on_issue_id ON reports USING btree (issue_id);
 
 
 --
--- Name: index_reports_on_reporter_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
+-- Name: index_reports_on_reporter_user_id; Type: INDEX; Schema: public; Owner: -
 --
 
 CREATE INDEX index_reports_on_reporter_user_id ON reports USING btree (reporter_user_id);
@@ -2468,6 +2476,14 @@ ALTER TABLE ONLY issues
     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;
+
+
 --
 -- Name: messages_from_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
 --
@@ -2786,9 +2802,13 @@ INSERT INTO schema_migrations (version) VALUES ('20150111192335');
 
 INSERT INTO schema_migrations (version) VALUES ('20150222101847');
 
-INSERT INTO schema_migrations (version) VALUES ('20150516073616');
+INSERT INTO schema_migrations (version) VALUES ('20150818224516');
 
-INSERT INTO schema_migrations (version) VALUES ('20150526130032');
+INSERT INTO schema_migrations (version) VALUES ('20160822153055');
+
+INSERT INTO schema_migrations (version) VALUES ('20160822153115');
+
+INSERT INTO schema_migrations (version) VALUES ('20160822153153');
 
 INSERT INTO schema_migrations (version) VALUES ('21');
 
@@ -2877,4 +2897,3 @@ INSERT INTO schema_migrations (version) VALUES ('7');
 INSERT INTO schema_migrations (version) VALUES ('8');
 
 INSERT INTO schema_migrations (version) VALUES ('9');
-