add optional shared link to templates
This commit is contained in:
committed by
Pete Matsyburka
parent
c91b4a765b
commit
e77b5fa2c9
@@ -0,0 +1,22 @@
|
||||
# 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, if_not_exists: true
|
||||
|
||||
MigrationTemplate.where(shared_link: nil).in_batches.update_all(shared_link: true)
|
||||
|
||||
change_column_default :templates, :shared_link, from: nil, to: false
|
||||
change_column_null :templates, :shared_link, false
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :templates, :shared_link
|
||||
end
|
||||
end
|
||||
@@ -361,6 +361,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_05_30_080846) do
|
||||
t.bigint "folder_id", null: false
|
||||
t.string "external_id"
|
||||
t.text "preferences", null: false
|
||||
t.boolean "shared_link", default: false, null: false
|
||||
t.index ["account_id"], name: "index_templates_on_account_id"
|
||||
t.index ["author_id"], name: "index_templates_on_author_id"
|
||||
t.index ["external_id"], name: "index_templates_on_external_id"
|
||||
|
||||
Reference in New Issue
Block a user