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/20240416170023_add_preferen...

16 lines
384 B

# frozen_string_literal: true
class AddPreferencesToTemplates < ActiveRecord::Migration[7.1]
class MigrationTemplate < ApplicationRecord
self.table_name = 'templates'
end
def change
add_column :templates, :preferences, :text
MigrationTemplate.where(preferences: nil).update_all(preferences: '{}')
change_column_null :templates, :preferences, false
end
end