From 13b4d7953adfa8455f800a56124c7d6ecafa41ca Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Fri, 10 Jan 2020 14:19:04 -0600 Subject: add ability to toggle individual filters without deleting them --- db/migrate/20200110195612_toggleable_filters.rb | 7 +++++++ db/structure.sql | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20200110195612_toggleable_filters.rb (limited to 'db') diff --git a/db/migrate/20200110195612_toggleable_filters.rb b/db/migrate/20200110195612_toggleable_filters.rb new file mode 100644 index 000000000..4bc521bf3 --- /dev/null +++ b/db/migrate/20200110195612_toggleable_filters.rb @@ -0,0 +1,7 @@ +class ToggleableFilters < ActiveRecord::Migration[5.2] + def change + safety_assured { + add_column :custom_filters, :is_enabled, :boolean, null: false, default: true + } + end +end diff --git a/db/structure.sql b/db/structure.sql index 3ac813d4c..de17e54f8 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -113,6 +113,17 @@ CREATE FUNCTION public.timestamp_id(table_name text) RETURNS bigint $$; +-- +-- Name: tsquery_union(tsquery); Type: AGGREGATE; Schema: public; Owner: - +-- + +CREATE AGGREGATE public.tsquery_union(tsquery) ( + SFUNC = tsquery_or, + STYPE = tsquery, + PARALLEL = safe +); + + -- -- Name: fedi; Type: TEXT SEARCH CONFIGURATION; Schema: public; Owner: - -- @@ -862,7 +873,8 @@ CREATE TABLE public.custom_filters ( expires_at timestamp without time zone, phrase text DEFAULT ''::text NOT NULL, created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + updated_at timestamp without time zone NOT NULL, + is_enabled boolean DEFAULT true NOT NULL ); @@ -5377,6 +5389,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20191221195147'), ('20200108051211'), ('20200109191740'), -('20200110072034'); +('20200110072034'), +('20200110195612'); -- cgit