Drop forum subscriptions.

Few people used forum subscriptions (only around 100), and even fewer
people were subscribed to active threads. Most subscriptions were for
old threads that will never be bumped again. The implementation also had
a few problems:

* Unsubscribe links in emails didn't work (they unset the user's
  receive_email_notifications flag, but forum subscriptions didn't
  respect this flag).
* Some users had invalid email addresses, which caused notifications to
  bounce. There was no mechanism for preventing bounces.
* The implementation wasn't scalable. It involved a daily linear scan
  over _all_ forum subscriptions looking for any topics that had been updated.
This commit is contained in:
evazion
2020-01-19 13:44:09 -06:00
parent cae9a5d7e3
commit 13528ac2d3
12 changed files with 11 additions and 149 deletions

View File

@@ -2014,38 +2014,6 @@ CREATE SEQUENCE public.forum_posts_id_seq
ALTER SEQUENCE public.forum_posts_id_seq OWNED BY public.forum_posts.id;
--
-- Name: forum_subscriptions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.forum_subscriptions (
id integer NOT NULL,
user_id integer,
forum_topic_id integer,
last_read_at timestamp without time zone,
delete_key character varying
);
--
-- Name: forum_subscriptions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.forum_subscriptions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: forum_subscriptions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.forum_subscriptions_id_seq OWNED BY public.forum_subscriptions.id;
--
-- Name: forum_topic_visits; Type: TABLE; Schema: public; Owner: -
--
@@ -4040,13 +4008,6 @@ ALTER TABLE ONLY public.forum_post_votes ALTER COLUMN id SET DEFAULT nextval('pu
ALTER TABLE ONLY public.forum_posts ALTER COLUMN id SET DEFAULT nextval('public.forum_posts_id_seq'::regclass);
--
-- Name: forum_subscriptions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.forum_subscriptions ALTER COLUMN id SET DEFAULT nextval('public.forum_subscriptions_id_seq'::regclass);
--
-- Name: forum_topic_visits id; Type: DEFAULT; Schema: public; Owner: -
--
@@ -4394,14 +4355,6 @@ ALTER TABLE ONLY public.forum_posts
ADD CONSTRAINT forum_posts_pkey PRIMARY KEY (id);
--
-- Name: forum_subscriptions forum_subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.forum_subscriptions
ADD CONSTRAINT forum_subscriptions_pkey PRIMARY KEY (id);
--
-- Name: forum_topic_visits forum_topic_visits_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
@@ -6425,20 +6378,6 @@ CREATE INDEX index_forum_posts_on_topic_id ON public.forum_posts USING btree (to
CREATE INDEX index_forum_posts_on_updated_at ON public.forum_posts USING btree (updated_at);
--
-- Name: index_forum_subscriptions_on_forum_topic_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_forum_subscriptions_on_forum_topic_id ON public.forum_subscriptions USING btree (forum_topic_id);
--
-- Name: index_forum_subscriptions_on_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_forum_subscriptions_on_user_id ON public.forum_subscriptions USING btree (user_id);
--
-- Name: index_forum_topic_visits_on_forum_topic_id; Type: INDEX; Schema: public; Owner: -
--
@@ -7426,6 +7365,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20200115010442'),
('20200117220602'),
('20200118015014'),
('20200119184442');
('20200119184442'),
('20200119193110');