From b5ab9d67d2a9e6e70124f8dc1271981854544e47 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 29 Jan 2023 20:58:19 +0100 Subject: [PATCH] Add migration to use body text value for raised texts in themes --- ...94809_use_body_text_for_raised_texts_in_themes.rb | 12 ++++++++++++ db/schema.rb | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20230129194809_use_body_text_for_raised_texts_in_themes.rb diff --git a/db/migrate/20230129194809_use_body_text_for_raised_texts_in_themes.rb b/db/migrate/20230129194809_use_body_text_for_raised_texts_in_themes.rb new file mode 100644 index 00000000..b8b574a1 --- /dev/null +++ b/db/migrate/20230129194809_use_body_text_for_raised_texts_in_themes.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class UseBodyTextForRaisedTextsInThemes < ActiveRecord::Migration[6.1] + def change + execute <<~SQUIRREL + UPDATE themes + SET raised_text = body_text, + raised_accent_text = body_text + WHERE body_text != 0; + SQUIRREL + end +end diff --git a/db/schema.rb b/db/schema.rb index d95c380d..82edbdda 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: 2023_01_23_214851) do +ActiveRecord::Schema.define(version: 2023_01_29_194809) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql"