Permalink
Browse files

Change spam marking

  • Loading branch information...
1 parent 2268fe1 commit 63f16c69324db73d22049cec7b260ff068e0c6f9 @chrisdone committed Apr 19, 2016
Showing with 16 additions and 16 deletions.
  1. +15 −14 sql/schema.sql
  2. +1 −2 src/Hpaste/Model/Paste.hs
View
@@ -43,7 +43,7 @@ SET default_tablespace = '';
SET default_with_oids = false;
--
--- Name: channel; Type: TABLE; Schema: public; Owner: -; Tablespace:
+-- Name: channel; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE channel (
@@ -72,7 +72,7 @@ ALTER SEQUENCE channel_id_seq OWNED BY channel.id;
--
--- Name: hint; Type: TABLE; Schema: public; Owner: -; Tablespace:
+-- Name: hint; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE hint (
@@ -103,7 +103,7 @@ ALTER SEQUENCE hint_id_seq OWNED BY hint.id;
--
--- Name: language; Type: TABLE; Schema: public; Owner: -; Tablespace:
+-- Name: language; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE language (
@@ -135,7 +135,7 @@ ALTER SEQUENCE language_id_seq OWNED BY language.id;
--
--- Name: paste; Type: TABLE; Schema: public; Owner: -; Tablespace:
+-- Name: paste; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE paste (
@@ -177,7 +177,7 @@ ALTER SEQUENCE paste_id_seq OWNED BY paste.id;
--
--- Name: report; Type: TABLE; Schema: public; Owner: -; Tablespace:
+-- Name: report; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE report (
@@ -232,7 +232,7 @@ ALTER SEQUENCE report_id_seq OWNED BY report.id;
--
--- Name: step; Type: TABLE; Schema: public; Owner: -; Tablespace:
+-- Name: step; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE step (
@@ -278,61 +278,61 @@ ALTER TABLE ONLY report ALTER COLUMN id SET DEFAULT nextval('report_id_seq'::reg
--
--- Name: channel_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+-- Name: channel_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY channel
ADD CONSTRAINT channel_pkey PRIMARY KEY (id);
--
--- Name: hint_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+-- Name: hint_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY hint
ADD CONSTRAINT hint_pkey PRIMARY KEY (id);
--
--- Name: language_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+-- Name: language_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY language
ADD CONSTRAINT language_pkey PRIMARY KEY (id);
--
--- Name: paste_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+-- Name: paste_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY paste
ADD CONSTRAINT paste_pkey PRIMARY KEY (id);
--
--- Name: report_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+-- Name: report_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY report
ADD CONSTRAINT report_pkey PRIMARY KEY (id);
--
--- Name: paste_author_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
+-- Name: paste_author_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE INDEX paste_author_index ON paste USING btree (author);
--
--- Name: paste_date_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
+-- Name: paste_date_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE INDEX paste_date_index ON paste USING btree (created);
--
--- Name: paste_title_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
+-- Name: paste_title_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE INDEX paste_title_index ON paste USING btree (title);
@@ -400,3 +400,4 @@ GRANT ALL ON SCHEMA public TO PUBLIC;
-- PostgreSQL database dump complete
--
+ALTER TABLE paste ADD flaggedspam BOOL NOT NULL DEFAULT FALSE;
@@ -59,10 +59,9 @@ disregardReport :: Integer -> HPModel ()
disregardReport pid =
void (exec ["DELETE FROM report WHERE paste = ?"] (Only pid))
-
markSpamPaste :: Integer -> HPModel ()
markSpamPaste pid =
- do void (exec ["UPDATE paste SET spamrating = 1 WHERE id = ? "]
+ do void (exec ["UPDATE paste SET markedspam = true AND public = false WHERE id = ? "]
(Only pid))
void (exec ["DELETE FROM report WHERE paste = ?"] (Only pid))

0 comments on commit 63f16c6

Please sign in to comment.