Merge pull request #2023 from okriuchykhin/ok_SCI_3726

Update trim_html_tags Postgres function [SCI-3726]
This commit is contained in:
Alex Kriuchykhin 2019-09-09 11:18:57 +02:00 committed by GitHub
commit 6a17667d39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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"