mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 09:23:58 +08:00
Update trim_html_tags Postgres function [SCI-3726]
This commit is contained in:
parent
6cc38de747
commit
419a4c8e8c
2 changed files with 13 additions and 1 deletions
12
db/migrate/20190830141257_update_trim_html_tags_function.rb
Normal file
12
db/migrate/20190830141257_update_trim_html_tags_function.rb
Normal 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
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue