mirror of https://github.com/docusealco/docuseal
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.
25 lines
630 B
25 lines
630 B
# frozen_string_literal: true
|
|
|
|
class AddSharedLinkToTemplates < ActiveRecord::Migration[8.0]
|
|
disable_ddl_transaction
|
|
|
|
class MigrationTemplate < ActiveRecord::Base
|
|
self.table_name = 'templates'
|
|
end
|
|
|
|
def up
|
|
add_column :templates, :shared_link, :boolean, default: false, null: false, if_not_exists: true
|
|
|
|
MigrationTemplate.where(shared_link: nil).in_batches.update_all(shared_link: true)
|
|
|
|
change_table :templates, bulk: true do |t|
|
|
t.change_default :shared_link, from: nil, to: false
|
|
t.change_null :shared_link, false
|
|
end
|
|
end
|
|
|
|
def down
|
|
remove_column :templates, :shared_link
|
|
end
|
|
end
|