diff --git a/db/migrate/20190830141257_update_trim_html_tags_function.rb b/db/migrate/20190830141257_update_trim_html_tags_function.rb new file mode 100644 index 000000000..5aecbb38a --- /dev/null +++ b/db/migrate/20190830141257_update_trim_html_tags_function.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class UpdateTrimHtmlTagsFunction < ActiveRecord::Migration[5.2] + def up + execute( + "CREATE OR REPLACE FUNCTION + trim_html_tags(IN input TEXT, OUT output TEXT) AS $$ + SELECT regexp_replace(input, E'<[^>]*>', '', 'g'); + $$ LANGUAGE SQL;" + ) + end +end diff --git a/db/schema.rb b/db/schema.rb index aabea8408..a210035d2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_08_12_072649) do +ActiveRecord::Schema.define(version: 2019_08_30_141257) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gist"