Update trim_html_tags Postgres function [SCI-3726]

This commit is contained in:
Oleksii Kriuchykhin 2019-08-30 16:42:03 +02:00
parent 6cc38de747
commit 419a4c8e8c
2 changed files with 13 additions and 1 deletions

View file

@ -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

View file

@ -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"