preserve submitter preferences

This commit is contained in:
Pete Matsyburka
2023-11-23 20:03:52 +02:00
parent 514987138a
commit 01333e5b2e
19 changed files with 252 additions and 65 deletions
@@ -0,0 +1,15 @@
# frozen_string_literal: true
class AddPreferencesToSubmissions < ActiveRecord::Migration[7.0]
class MigrationSubmission < ApplicationRecord
self.table_name = 'submissions'
end
def change
add_column :submissions, :preferences, :text
MigrationSubmission.where(preferences: nil).update_all(preferences: '{}')
change_column_null :submissions, :preferences, false
end
end