fix: move beamer backfill to new migration
This commit is contained in:
parent
68b72cc01a
commit
35c8591af3
|
|
@ -14,12 +14,6 @@ class ReplaceBeamerAssetFieldsWithConfig < ActiveRecord::Migration[7.0]
|
|||
END
|
||||
SQL
|
||||
|
||||
execute <<~SQL.squish
|
||||
UPDATE beamers
|
||||
SET config = '{"match_filter":"state:in_progress"}'
|
||||
WHERE name = 'default'
|
||||
SQL
|
||||
|
||||
change_column_default :beamers, :display_state, from: 'matches_all', to: 'during_game'
|
||||
remove_column :beamers, :qr_code_url, :string
|
||||
remove_column :beamers, :logo_url, :string
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class BackfillDefaultBeamerConfig < ActiveRecord::Migration[7.0]
|
||||
def up
|
||||
execute <<~SQL.squish
|
||||
UPDATE beamers
|
||||
SET config = '{"match_filter":"state:in_progress"}'
|
||||
WHERE name = 'default'
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
execute <<~SQL.squish
|
||||
UPDATE beamers
|
||||
SET config = '{}'
|
||||
WHERE name = 'default'
|
||||
SQL
|
||||
end
|
||||
end
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2026_04_26_120000) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2026_04_26_121000) do
|
||||
create_table "beamers", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "display_state", default: "during_game", null: false
|
||||
|
|
|
|||
Loading…
Reference in New Issue