From cfe1da3390177221112708ec936d64d0c1b1f365 Mon Sep 17 00:00:00 2001 From: Pablo Brasero Date: Fri, 21 Nov 2025 13:50:06 +0000 Subject: [PATCH] Add DB-backed model SpammyPhrases --- app/models/spammy_phrase.rb | 13 +++++ .../20251121134648_create_spammy_phrases.rb | 10 ++++ db/structure.sql | 47 +++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 app/models/spammy_phrase.rb create mode 100644 db/migrate/20251121134648_create_spammy_phrases.rb diff --git a/app/models/spammy_phrase.rb b/app/models/spammy_phrase.rb new file mode 100644 index 000000000..90742aedb --- /dev/null +++ b/app/models/spammy_phrase.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# == Schema Information +# +# Table name: spammy_phrases +# +# id :bigint not null, primary key +# phrase :string +# created_at :datetime not null +# updated_at :datetime not null +# +class SpammyPhrase < ApplicationRecord +end diff --git a/db/migrate/20251121134648_create_spammy_phrases.rb b/db/migrate/20251121134648_create_spammy_phrases.rb new file mode 100644 index 000000000..aeb69b0c5 --- /dev/null +++ b/db/migrate/20251121134648_create_spammy_phrases.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class CreateSpammyPhrases < ActiveRecord::Migration[8.0] + def change + create_table :spammy_phrases do |t| + t.string :phrase + t.timestamps + end + end +end diff --git a/db/structure.sql b/db/structure.sql index 3fdc48df4..519dc858c 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1409,6 +1409,37 @@ CREATE SEQUENCE public.social_links_id_seq ALTER SEQUENCE public.social_links_id_seq OWNED BY public.social_links.id; +-- +-- Name: spammy_phrases; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.spammy_phrases ( + id bigint NOT NULL, + phrase character varying, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL +); + + +-- +-- Name: spammy_phrases_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.spammy_phrases_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: spammy_phrases_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.spammy_phrases_id_seq OWNED BY public.spammy_phrases.id; + + -- -- Name: user_blocks; Type: TABLE; Schema: public; Owner: - -- @@ -1812,6 +1843,13 @@ ALTER TABLE ONLY public.reports ALTER COLUMN id SET DEFAULT nextval('public.repo ALTER TABLE ONLY public.social_links ALTER COLUMN id SET DEFAULT nextval('public.social_links_id_seq'::regclass); +-- +-- Name: spammy_phrases id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.spammy_phrases ALTER COLUMN id SET DEFAULT nextval('public.spammy_phrases_id_seq'::regclass); + + -- -- Name: user_blocks id; Type: DEFAULT; Schema: public; Owner: - -- @@ -2184,6 +2222,14 @@ ALTER TABLE ONLY public.social_links ADD CONSTRAINT social_links_pkey PRIMARY KEY (id); +-- +-- Name: spammy_phrases spammy_phrases_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.spammy_phrases + ADD CONSTRAINT spammy_phrases_pkey PRIMARY KEY (id); + + -- -- Name: user_blocks user_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -3523,6 +3569,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('23'), ('22'), ('21'), +('20251121134648'), ('20250704143751'), ('20250506052030'), ('20250304172798'), -- 2.39.5