You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docuseal/db/migrate/20231122203347_add_preferen...

16 lines
396 B

# 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